#include <iostream> #include <map> #include <unordered_map> using namespace std; int main() { map<int, int>umap; int n; cin >> n; int key, value; while (n--) { cin >> key >> value; umap[key] += value; } for (auto&...