#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; const double PI=acos(-1); int main(){ int N; cin>>N; vector

order; map dogid; for(int i=0;i>x>>y; order.emplace_back(x,y); dogid[make_pair(x,y)]=i; } vector> ans; sort(order.begin(),order.end()); for(int i=0;i+1