#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N; vector L(N),R(N); vector> S(N); for(int i=0;i>a>>b; L[i]=a; R[i]=b; S[i]=mp(a,b); } sort(all(L)); sort(all(R)); reverse(all(R)); ll le=-INF,ri=INF; for(int i=0;i,greater> PQ; int j=0; for(int i=1;i<=N;i++){ while(jx){ cout<<0<<"\n"; return 0; } } } cout<