#include #include #include #include #include using namespace std; const int MAXN = 10; struct Point { double x,y; }p[MAXN]; bool cmp(Point A, Point B) { if(A.x == B.x) { return A.y < B.y; } return A.x < B.x; } double solve(Point A, Point B) { return sqrt((A.y - B.y) * (A.y - B.y) + (A.x - B.x) * (A.x - B.x)); } int main() { //freopen("Input.txt","r",stdin); int T; scanf("%d",&T); while(T--) { int flag = 1; for(int i = 0; i < 5; i++) { scanf("%lf%lf",&p[i].x,&p[i].y); } sort(p,p+5,cmp); double d = solve(p[0],p[1]); //fabs(d - solve(p[0],p[2])) >= 0.0001; if(fabs(d - solve(p[0],p[2])) >= 0.0001 || fabs(d - solve(p[4],p[2])) >= 0.0001 || fabs(d - solve(p[4],p[3])) >= 0.0001 || fabs(d - solve(p[1],p[3])) >= 0.0001) { printf("No\n"); } else { printf("Yes\n"); } } return 0; }