#include #include #define MAX 1000005 #define MOD 1000000007 #define MA 1200000 #define PI 3.14159265358979323846264338327950 //const int MAXA=1e15+1; typedef long long int ll; const int INF=1e18; using namespace std; const int maxn=1e5+5; const int ma=1e9+5; int x[15],y[15]; int main() { //freopen("input.txt","r+",stdin); //freopen("output.txt","w+",stdout); ios::sync_with_stdio(0); cin.tie(0); int t,n,i; cin>>t; while(t--) { cin>>n; int f=0,minx=INT_MAX,miny=INT_MAX,maxx=INT_MIN,maxy=INT_MIN; for(i=0;i>x[i]>>y[i]; minx=min(minx,x[i]); maxx=max(maxx,x[i]); miny=min(miny,y[i]); maxy=max(maxy,y[i]); } for(i=0;imaxy) f=1; } else if(x[i]==maxx) { if(y[i]maxy) f=1; } else if(y[i]==miny) { if(x[i]maxx) f=1; } else if(y[i]==maxy) { if(x[i]maxx) f=1; } else f=1; } else f=1; } if(f) printf("NO\n"); else printf("YES\n"); } return 0; }