#include using namespace std; #define forn(i,n) for(int i=0;i=0;--i) #define out(a) {cout<b)?(a):(b)) #define min(a,b) ((a x; vector y; int check(int x1,int y1,int x2,int y2){ // cout<>n; int a,b; x.clear(); y.clear(); int x1 = 1000000,x2= -100000,y1= 1000000,y2= -100000; for(int i=0;i>a>>b; x1 = min(x1,a); x2 = max(x2,a); y1 = min(y1,b); y2 = max(y2,b); x.push_back(a); y.push_back(b); } int t = 0; t+=check(x1,y1,x2,y1+x2-x1); t+=check(x1,y1,x1+y2-y1,y2); t+=check(x2 - (y2-y1) ,y1,x2,y2); t+=check(x1,y2-(x2-x1),x2,y2); if(x1==x2 || y1 == y2) ++t; t+=check(x1,y1,x2,y2); if(t) cout<<"YES\n"; else cout<<"NO\n"; return 0; } int main(){ int test; cin>>test; while(test--){ solve(); } }