贪心
尽可能让最强的赢,最弱的赢,都不行则最弱打最强
感性的想,我肯定要尽可能的赢,而且赢的要对等
实在不能赢就拿最小的拼,所谓的田忌赛马策略
由于总分一定,己方最差即己方最好时对方的分数
type list=array[..] of longint;
var a,b:list;
n,i:longint; procedure qsort(var a:list);
procedure sort(l,r: longint);
var i,j,x,y: longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div ];
repeat
while a[i]>x do inc(i);
while x>a[j] do dec(j);
if not(i>j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:=y;
inc(i);
j:=j-;
end;
until i>j;
if l<j then sort(l,j);
if i<r then sort(i,r);
end; begin
sort(,n);
end; function ans(a,b:list):longint;
var h1,t1,h2,t2:longint;
begin
ans:=;
h1:=;
h2:=;
t1:=n;
t2:=n;
while (h1<=t1) do
begin
if a[h1]>b[h2] then
begin
inc(h1);
inc(h2);
ans:=ans+;
end
else if a[t1]>b[t2] then
begin
dec(t1);
dec(t2);
ans:=ans+;
end
else begin
if a[t1]=b[h2] then inc(ans);
dec(t1);
inc(h2);
end;
end;
end; begin
readln(n);
for i:= to n do
readln(a[i]);
qsort(a);
for i:= to n do
readln(b[i]);
qsort(b);
writeln(ans(a,b),' ',*n-ans(b,a));
end.