Pagini recente » Statistici Rares Gherasa (raresgherasa) | Monitorul de evaluare | Rating Ignat Dragos (EpicBrotato1) | Monitorul de evaluare | Cod sursa (job #1974115)
var f,g:text;
a,nr:array[1..2000000]of int64;
n,i,max:longint;
k:int64;
begin
assign(f,'elmaj.in');
assign(g,'elmaj.out');
reset(f);
rewrite(g);
read(f,n);
for i:=1 to n do
begin
read(f,a[i]);
nr[a[i]]:=nr[a[i]]+1;
end;
max:=0;
for i:=1 to n do
if max<nr[a[i]] then begin
max:=nr[a[i]];
k:=a[i];
end;
write(g,max,' ',k);
close(f);
close(g);
end.