#include <iostream> #include <unordered_map> #include <vector> #include <algorithm> using namespace std; int main() { int n; unordered_map<int, int> res; cin >> n; while (n--) { int n1, n2; cin >> n1 >> n2; if (...