Pagini recente » Cod sursa (job #2172113) | Cod sursa (job #784265) | Cod sursa (job #3240879) | Cod sursa (job #1183718) | Cod sursa (job #1608310)
#include <fstream>
#include <map>
using namespace std;
ifstream cin("elmaj.in");
ofstream cout("elmaj.out");
map<long long,int> x;
int n,aux,i;
int main()
{
cin>>n;
for(i=1;i<=n;i++){
cin>>aux;
x[aux]++;
}
for(map<long long,int>::iterator it=x.begin();it!=x.end();++it)
if(it->second>=n/2+1){
cout<<it->first<<' '<<it->second;
return 0;
}
cout<<-1;
return 0;
}