#include <iostream>
#include <string.h>
#include <cstdio>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define MAXN 222
#define eps 1e-8
int sid( double a)
{
if(a > eps)
return 1;
if(a > -eps && a < eps)
return 0;
if(a < -eps)
return -1;
}
struct Point
{
double x, y;
Point (){};
Point ( double a, double b)
{
x = a;
y = b;
}
}p[MAXN];
int n;
double Across( Point a, Point b, Point c)
{
return (b.x - a.x)*(c.y - a.y) - (b.y - a.y)*(c.x - a.x);
}
void solve( )
{
bool flag = true;
for( int i = 1; i <= 2*n; i++)
{
for(int j = i+1; j <= 2*n; j++)
{
flag = true;
//printf("%lf --- > %lf\n", p[i].x - p[j].x, p[i].y - p[j].y);
if(sid(p[i].x - p[j].x) == 0 && sid(p[i].y - p[j].y) == 0)
continue;
for( int k = 1; k < 2*n; k += 2)
{
int d1 = sid(Across(p[i], p[j], p[k]));
int d2 = sid(Across(p[i], p[j], p[k+1]));
// printf("%d ---0000--> %d\n",d1, d2);
if(d1*d2 > 0)
{
flag = false;
break;
}
}
if(flag)
{
printf("Yes!\n");
return ;
}
}
}
printf("No!\n");
return ;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for( int i = 1; i <= 2* n; i++)
scanf("%lf %lf",&p[i].x, &p[i].y);
solve( );
}
}
#include <string.h>
#include <cstdio>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define MAXN 222
#define eps 1e-8
int sid( double a)
{
if(a > eps)
return 1;
if(a > -eps && a < eps)
return 0;
if(a < -eps)
return -1;
}
struct Point
{
double x, y;
Point (){};
Point ( double a, double b)
{
x = a;
y = b;
}
}p[MAXN];
int n;
double Across( Point a, Point b, Point c)
{
return (b.x - a.x)*(c.y - a.y) - (b.y - a.y)*(c.x - a.x);
}
void solve( )
{
bool flag = true;
for( int i = 1; i <= 2*n; i++)
{
for(int j = i+1; j <= 2*n; j++)
{
flag = true;
//printf("%lf --- > %lf\n", p[i].x - p[j].x, p[i].y - p[j].y);
if(sid(p[i].x - p[j].x) == 0 && sid(p[i].y - p[j].y) == 0)
continue;
for( int k = 1; k < 2*n; k += 2)
{
int d1 = sid(Across(p[i], p[j], p[k]));
int d2 = sid(Across(p[i], p[j], p[k+1]));
// printf("%d ---0000--> %d\n",d1, d2);
if(d1*d2 > 0)
{
flag = false;
break;
}
}
if(flag)
{
printf("Yes!\n");
return ;
}
}
}
printf("No!\n");
return ;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for( int i = 1; i <= 2* n; i++)
scanf("%lf %lf",&p[i].x, &p[i].y);
solve( );
}
}