//枚举过每一条线段的直线,
//再判断其他线段的点在直线上或被直线穿过
//即求直线与线段相交(叉积)
#include<stdio.h>
#include<math.h>
#define esp 1e-8
struct Node
{
double x,y;
} a[],b[],c[],tmp1,tmp2;
double cal(Node a,Node b,Node c)//ca*cb
{
return ((a.x-c.x)*(b.y-c.y)-(b.x-c.x)*(a.y-c.y));
}
double diji(Node a,Node b,Node c)//ab·ac
{
return (b.x-a.x)*(c.x-a.x)+(b.y-a.y)*(c.y-a.y);
}
int main()
{
int _case,i,j,k,n;
scanf("%d",&_case);
while(_case--)
{
scanf("%d",&n);
for(i=; i<n; i++)
{
scanf("%lf%lf",&a[i].x,&a[i].y);
c[*i]=a[i];
scanf("%lf%lf",&b[i].x,&b[i].y);
c[*i+]=b[i];
}
for(i=; i<*n; i++)
{
tmp1=c[i];
for(k=i+; k<*n; k++)
{
tmp2=c[k];
if(fabs(tmp1.x-tmp2.x)<esp&&fabs(tmp1.y-tmp2.y)<esp)continue;//判断重点
//printf("%d#\n",i);
for(j=; j<n; j++)
{
double k=cal(a[j],tmp2,tmp1)*cal(b[j],tmp2,tmp1); if(k>esp)break;
}
if(j==n)break;
}
if(j==n)break;
}
if(j!=n)printf("No!\n");
else printf("Yes!\n");
}
return ;
}