Pagini recente » Cod sursa (job #680) | Cod sursa (job #497074) | Cod sursa (job #1925822) | Cod sursa (job #1554202) | Cod sursa (job #1608333)
#include <fstream>
#include <map>
using namespace std;
map<long long,long long> x;
ifstream cin("elmaj.in");
ofstream cout("elmaj.out");
int n,aux,i;
int main()
{
cin>>n;
for(i=1;i<=n;i++){
cin>>aux;
x[aux]++;
}
for(map<long long,long long>::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;
}