#include #include #include #include int main() { int q; scanf("%d",&q); while(q--){ int n; scanf("%d",&n); int a[n][2],i; for(i=0;imaxwidth) maxwidth= a[i][1]; //f= a[i][1]; //give = i; //check=1; //break; if(a[i][1]maxlength) maxlength = a[i][0]; if(a[i][0]minlength) && (a[i][1]minwidth)) flag=1; } // } if(flag==1) printf("NO\n"); else printf("YES\n"); } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }