#include using namespace std; #define F first #define S second #define pb push_back #define mp make_pair #define var(X) cerr << " --> " << #X << " = " << X << endl #define arr(a,n) for(int i=0;i vi; typedef pair ii; typedef vector > vii; const double eps = 1e-10, pi = acos(-1.0); int a[15],b[15]; int main() { /* #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("out.txt","w",stdout); #endif */ int t=1,cs=1; //ios_base::sync_with_stdio(0); cin.tie(0); //clock_t start=clock(); scanf("%d",&t); while(t--) { int n,f=1,xmax=-10000,ymax=-10000,xmin=10000,ymin=10000; cin>>n; for(int i=0;i>a[i]>>b[i]; xmax=max(a[i],xmax); xmin=min(a[i],xmin); ymax=max(b[i],ymax); ymin=min(b[i],ymin); } //cout<ymax) { f=0; break; } } else { if(a[i]xmax) { f=0; break; } } if(f==0) cout<<"NO\n"; else cout<<"YES\n"; } //clock_t end=clock(); //cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <