#include<bits/stdc++.h> using namespace std; int main() { int n; while( ~scanf("%d",&n) ) { map<int,int> mp; while( n-- ) { int key,value; scanf("%d%d",&key, &value ); mp[key]+=value; } ...