#include #include #include #include #include using namespace std; int main() { int q; cin>>q; while(q--){ vector x,y; int n; cin>>n; int _x,_y; set xs,ys; bool flag1=true; int px,py; int ymx=-INT_MAX,ymn=INT_MAX; for(int i=0;i>_x>>_y; x.push_back(_x); y.push_back(_y); ymx=max(ymx,_y); ymn=min(ymn,_y); xs.insert(_x); ys.insert(_y); } if(xs.size()<=2||ys.size()<=2){ cout<<"YES"< xx; for(int k=0;k=xmx||x[k]<=xmn) { xx.insert(x[k]); } else flag=false; } // } } if(xx.size()>2)flag=false; // cout<<" flag"<