#include #define mp make_pair #define vi vector #define xx first #define yy second #define all(a) a.begin(), a.end() #define vsort(v) sort(all(v)) #define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end()) #define clr(a,k) memset(a,k,sizeof a) #define bclr(b) memset(b,false,sizeof b) #define fr(i, a) for(i = 0; i < a; i++) #define frr(i,a) for(i = a - 1; i >= 0, i--) #define LL long long #define ll long long #define pb push_back #define pii pair #define vll vector ///***** bit *****/// #define check_bit(a, b) (a&(1< using namespace std; ///******* Template ********/// template inline T bigmod(T p,T e,T M) { if(e==0)return 1; if(e%2==0) { T t=bigmod(p,e/2,M); return (t*t)%M; } return (bigmod(p,e-1,M)*p)%M; } template inline T gcd(T a,T b) { if(b==0)return a; return gcd(b,a%b); } template inline T modinverse(T a,T M) { return bigmod(a,M-2,M); } /** return (a * b) % m; where a, b, m <= 10^18 **/ template inline T multimod(T a, T b, T m) { T ans = 0ll; a%=m, b%=m; while(b) { if(b&1ll) ans = m - ans > a?(ans + a): (ans + a - m); b >>= 1ll; a = (m - a)>a?a+a:a+a-m; } return (T)ans; } ///****** fast scan ends here ***********/// //int dr[] = {-1, 0, 1, 0}; //int dc[] = {0, 1, 0, -1}; /// 4 sides //int dr[] = {-1, -1, 0, 1, 1, 1, 0, -1}; dc[] = {0, 1, 1, 1, 0, -1, -1, -1}; /// 8 sides #define LEN(a) strlen(a) #define ull unsigned long long #define MX 10000000000000000ll #define lim 200000 /// 10^5 ///***** Template ends here *****/// ///********************* Code starts here **************************** int x[20]; int y[20]; int main() { // freopen("inp.txt", "r", stdin); int j, i; int a, t, n, b, u, k, v, cases = 1, m; string str; int q; cin>>q; while(q--) { cin>>n; int mnx = 1000000; int mny = 1000000; int mxy = -1000000; int mxx = -1000000; for(i = 0; i < n; i++) { cin>>x[i]>>y[i]; mnx = min(mnx, x[i]); mxx = max(mxx, x[i]); mny = min(mny, y[i]); mxy = max(mxy, y[i]); } for(i = 0; i < n; i++) { if(x[i] == mnx || x[i] == mxx || y[i] == mny || y[i]==mxy) { } else { cout<<"NO"<