#include<algorithm>#include<cmath>#include<cstdio>#include<cstring>#include<iostream>#include<string>// #define int long long#definedbg(x) cout << #x <<"==="<< x << endlusingnamespace std;constint N =1000+10;constdouble eps =1e-8;intsgn(double x){if(fabs(x)< eps)return0;return(x <0)?-1:1;}structPoint{double x, y;Point(){}Point(double _x,double _y){ x = _x, y = _y;}voidinput(){scanf("%lf%lf",&x,&y);}booloperator<(const Point &b)const{if(sgn(y - b.y)==0)returnsgn(x - b.x)<0;returnsgn(y - b.y)<0;}
Point operator-(const Point &b)const{returnPoint(x - b.x, y - b.y);}doubleoperator^(const Point &b)const{return x * b.y - y * b.x;}} p[N], mi;doublecross(Point a, Point b, Point c){return(b - a)^(c - a);}doubledis(Point a, Point b){returnsqrt((a.x - b.x)*(a.x - b.x)+(a.y - b.y)*(a.y - b.y));}int n;boolcmp(Point a, Point b){double t =cross(mi, a, b);if(sgn(t ==0))returnsgn(dis(mi, a)-dis(mi, b))<0;returnsgn(t)>0;}structpolygon{
Point p[N];int n;} a;//由a数组求凸包传给 P ———— 没想到求凸包这么简单,之前想得太难了,艹// Point *a,我们传送的是a的地址,函数中可以改变数组。a[]呢?voidgetconvex(Point *a,int n, polygon &convex){// Point mi = a[0];
mi = a[0];for(int i =1; i < n; i++) mi =min(mi, a[i]);sort(a, a + n, cmp);//极角排序:求凸包的准备工作int top =0;// top模拟栈顶
convex.p[top]= a[0];
convex.p[++top]= a[1];for(int i =2; i < n; i++){while(top >0&&(sgn(cross(convex.p[top -1], convex.p[top], a[i]))<=0))
top--;
convex.p[++top]= a[i];}
convex.n = top +1;// dbg(convex.n);// for (int i = 0; i < convex.n; i++) {// cout << ">>>" << i << " " << convex.p[i].x << " " << convex.p[i].y// << endl;// }}signedmain(){int T;
cin >> T;while(T--){scanf("%d",&n);for(int i =0; i < n; i++) p[i].input();getconvex(p, n, a);bool f =true;int cnt =0;for(int i =0; i < a.n; i++){
cnt =0;for(int j =0; j < n; j++){if(sgn(cross(a.p[i], a.p[(i +1)% a.n], p[j]))==0) cnt++;if(cnt ==3)break;}if(cnt <3){
f =false;break;}}if(a.n <=2) f =false;puts(f ?"YES":"NO");}return0;}