#include using namespace std; #define f first #define s second const int N=15; pair p[N]; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int q,n; cin>>q; while(q--){ cin>>n; int minx=INT_MAX,maxx=INT_MIN,miny=INT_MAX,maxy=INT_MIN; for(int i=0;i>p[i].f>>p[i].s; minx=min(minx,p[i].f); maxx=max(maxx,p[i].f); miny=min(miny,p[i].s); maxy=max(maxy,p[i].s); } bool pos=1; for(int i=0;imaxy) { pos=0; break;} } else if(y==miny || y==maxy){ if(xmaxx){ pos=0; break;} } else {pos=0; break;} } if(pos) cout<<"YES"<