from decimal import * def solve(a,b,c,d,e,f): sa=a-c sb=b-d ta=e-c tb=f-d # if there are any x>0 which makes s*t>0, it is answer. # (sa*x+sb)*(ta*x+tb)=Ax^2+Bx+C>0 A=sa*ta B=sa*tb+sb*ta C=sb*tb if ADecimal(0): # x=inf then f>0.OK return True elif A==Decimal(0): # f=Bx+C,C>0 or B>0 then OK. return C>Decimal(0) or B>Decimal(0) else: if B*B<4*A*C: return False # we can find two answers(suppose it's p and q). # if [p,q] contains positive number, is's OK. # => q=(-B+sqrt(B**2 - 4AC))/(2A)>0 return (-B+(B*B-4*A*C).sqrt())/(2*A)>Decimal(0) n=int(input()) for i in range(n): dat=list(map(Decimal,input().split())) if solve(dat[3],dat[0],dat[4],dat[1],dat[5],dat[2]): print("YES") else: print("NO")