import java.io.*; import java.util.*; class DegRec { public static void main(String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(in.readLine()); while(t-->0){ int n = Integer.parseInt(in.readLine()); int[][] a = new int[n][2]; boolean flag = true; int xmin=Integer.MAX_VALUE,xmax=Integer.MIN_VALUE,ymin=Integer.MAX_VALUE,ymax=Integer.MIN_VALUE; for(int i=0;ia[i][0])?a[i][0]:xmin; xmax = (xmaxa[i][1])?a[i][1]:ymin; ymax = (ymaxxmax || yymax){ flag=false; break; } if(y>ymin && yxmin && x