#include using namespace std; using ll=long long; int main(){ ll n; cin>>n; bool ans=0; vector> v; v.push_back({0,0}); for(int i=0;i>a>>b; v.push_back({a,b}); } sort(v.begin(),v.end()); for(int i=0;i