----------------------------------------------------------------------------------------------------------------
用C++完成
----------------------------------------------------------------------------------------------------------------
#include <cstdio>
const int maxn = 100000;
int school[maxn] = {0};
int main(){
int n,schID,score; scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d",&schID,&score);
school[schID] += score;
}
int k = 1;
int MAX = -1;
for(int i=0;i<=n;i++){
if(school[i]>MAX){
MAX = school[i]; k = i;
}
}
printf("%d %d",k,MAX);
return 0;
}