T=int(input()) for tests in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) dis1=(x1-x2)**2+(y1-y2)**2 dis2=(X1-X2)**2+(Y1-Y2)**2 if (x2-x1)*(Y2-Y1)!=(y2-y1)*(X2-X1): print("No") else: if dis2