import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in=new Scanner(System.in); int q=in.nextInt(); while(q>0) { int n=in.nextInt(); int a[][]=new int[n][2]; int max1=0; int min1=0; for(int i=0;i=min1 && a[i][j+1]<=max1) { flag++; } } } } if(flag==n) System.out.println("YES"); else System.out.println("NO"); q--; } } }