#include using namespace std; typedef pair P; int main(){ int n; cin>>n; P a[n]; for(int i=0;i>a[i].first>>a[i].second; sort(a,a+n); for(int i=0;i