#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int q; cin >> q; while(q--){ int n; cin >> n; vector > arr(n); vector arr_x(n),arr_y(n); bool flag = true; for(int i=0 ; i> arr[i].first >> arr[i].second; arr_x[+i] = arr[i].first; arr_y[i] = arr[i].second; } int max_x = *max_element(arr_x.begin(),arr_x.end()); int max_y = *max_element(arr_y.begin(),arr_y.end()); int min_x = *min_element(arr_x.begin(),arr_x.end()); int min_y = *min_element(arr_y.begin(),arr_y.end()); if((max_x > 0 && min_x < 0) || (max_y > 0 && min_y < 0)){ cout << "NO\n"; continue; } for(int i=0 ; i max_y || arr[i].second < min_y) ){ flag = false; break; } if(arr[i].first < max_x && arr[i].first > min_x && arr[i].second!=min_y && arr[i].second != max_y){ flag = false; break; } } if(flag) cout << "YES\n"; else cout << "NO\n"; } return 0; }