两个数组从小到大排序
最小和最大的能赢就赢 否则 用最小的打最大的,证明略
const int N = 100010;
int Dat[2][N], n;
inline void Input() {
scanf("%d", &n);
Rep(i, 2)
Rep(j, n) scanf("%d", &Dat[i][j]);
sort(Dat[0], Dat[0] + n), sort(Dat[1], Dat[1] + n);
}
inline int Work(int *A, int *B) {
int Ox1, Oy1, Ox2, Oy2, Ret;
Ret = Ox1 = Ox2 = 0, Oy1 = Oy2 = n - 1;
Rep(K, n)
if(A[Ox1] > B[Ox2]) Ret += 2, Ox1++, Ox2++;
else if(A[Oy1] > B[Oy2]) Ret += 2, Oy1--, Oy2--;
else Ret += (int) (A[Ox1++] == B[Oy2--]);
return Ret;
}
inline void Solve() {
printf("%d ", Work(Dat[0], Dat[1]));
printf("%d\n", (n << 1) - Work(Dat[1], Dat[0]));
}
int main() {
Input();
Solve();
return 0;
}