#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<int, int> m; while (n -- ) { int index, value; cin >> index >> value; m[index] += value; } for (auto &[idx, val...