#include #include #include #include /* C implementation QuickSort */ #include // A utility function to swap two elements void swap(long int* a, long int* b) { long int t = *a; *a = *b; *b = t; } /* This function takes last element as pivot, places the pivot element at its correct position in sorted array, and places all smaller (smaller than pivot) to left of pivot and all greater elements to right of pivot */ long int partition (long int arr[], long int low, long int high) { long int pivot = arr[high]; // pivot long int i = (low - 1); // Index of smaller element for (long int j = low; j <= high- 1; j++) { // If current element is smaller than or // equal to pivot if (arr[j] <= pivot) { i++; // increment index of smaller element swap(&arr[i], &arr[j]); } } swap(&arr[i + 1], &arr[high]); return (i + 1); } /* The main function that implements QuickSort arr[] --> Array to be sorted, low --> Starting index, high --> Ending index */ void quickSort(long int arr[], long int low,long int high) { if (low < high) { /* pi is partitioning index, arr[p] is now at right place */ long int pi = partition(arr, low, high); // Separately sort elements before // partition and after partition quickSort(arr, low, pi - 1); quickSort(arr, pi + 1, high); } } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long int t; scanf("%ld",&t); while(t>0) { t--; long int n,i,f1=0,f2=0,x1,X1,y1,Y1,res=0; scanf("%ld",&n); long int *x,*y; x=(long int*)malloc(sizeof(long int)*n); y=(long int*)malloc(sizeof(long int)*n); for(i=0;i=y1 && y[i]<=Y1)) res=1; } else if(y[i]==y1 || y[i]==Y1) { if(!(x[i]>=x1 && x[i]<=X1)) res=1; } else res=1; } if(res==0) printf("YES\n"); else printf("NO\n"); } return 0; }