/*************************************************
Author :supermaker
Created Time :2016/1/25 22:33:55
File Location :C:\Users\abcd\Desktop\TheEternalPoet
**************************************************/
#pragma comment(linker, "/STACK:102400000,102400000")
#include <set>
#include <bitset>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <string>
#include <vector>
#include <ios>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <complex>
#include <numeric>
#include <functional>
#include <cmath>
#include <ctime>
#include <climits>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cassert>
using namespace std;
#define CFF freopen ("aaa.txt", "r", stdin)
#define CPPFF ifstream cin ("aaa.txt")
#define DB(ccc) cout << #ccc << " = " << ccc << endl
#define PB push_back
#define MP(A, B) make_pair(A, B)
typedef long long LL;
typedef unsigned long long ULL;
typedef double DB;
typedef pair <int, int> PII;
typedef pair <int, bool> PIB;
const int INF = 0x7F7F7F7F;
const int MOD = 1e9 + 7;
const double EPS = 1e-10;
const double PI = 2 * acos (0.0);
const int maxn = 166 + 66;
int sgn (double val)
{
if (fabs (val) < EPS) return 0;
else if (val < 0) return -1;
else return 1;
}
struct Point
{
double x, y;
Point () {}
Point (double xx, double yy) : x (xx), y (yy) {}
Point operator + (const Point &a) const
{
return Point (x + a.x, y + a.y);
}
Point operator - (const Point &a) const
{
return Point (x - a.x, y - a.y);
}
double operator ^ (const Point &a) const
{
return x * a.y - y * a.x;
}
double operator * (const Point &a) const
{
return x * a.x + y * a.y;
}
};
struct Line
{
Point s, e;
Line () {}
Line (Point ss, Point ee) : s (ss), e (ee) {}
};
Line line[maxn];
int n;
bool SegInerLine (Line l1, Line l2)
{
return sgn ((l2.s - l1.e) ^ (l1.s - l1.e)) * sgn ((l2.e - l1.e) ^ (l1.s - l1.e)) <= 0;
}
bool check (Point a, Point b)
{
if (sgn (a.x - b.x) == 0 && sgn (a.y - b.y) == 0) return false;
Line tt = Line (a, b);
for (int i = 1; i <= n; i++)
if (!SegInerLine (tt, line[i]))
return false;
return true;
}
int main()
{
//CFF;
//CPPFF;
int t;
scanf ("%d", &t);
while (t--)
{
scanf ("%d", &n);
for (int i = 1; i <= n; i++)
{
double x1, y1, x2, y2;
scanf ("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);
line[i] = Line (Point (x1, y1), Point (x2, y2));
}
bool is_have = false;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
{
if (check (line[i].s, line[j].s) || check (line[i].s, line[j].e)
|| check (line[i].e, line[j].s) || check (line[i].e, line[j].e))
{
is_have = true;
break;
}
}
if (is_have) puts ("Yes!");
else puts ("No!");
}
return 0;
}