I,R=input,range J=lambda:map(int,I().split()) Q=int(I()) a,b,c,d,e,f=J() X=[a,c,e]*2 Y=[b,d,f]*2 def A(x,y): return x**2+y**2 def D(x,y): return A(s-x*t*v,(u-y*v)*t) for i in R(3): u,v=Y[i]+Y[i+1],2 s,t=X[i]+X[i+1],1 r=D(X[i],Y[i]) if D(X[i+2],Y[i+2])<=r:break else: L=[A(a,b)-A(c,d),A(e,f)-A(a,b)] u,v=(e-a)*L[0]+(c-a)*L[1],2*((e-a)*(b-d)-(c-a)*(b-f)) s=[2*(b-d)*u-v*L[0],2*(b-f)*u+v*L[1]][c==a] t=2*[c-a,e-a][c==a] r=D(a,b) for q in R(Q):print("YNeos"[D(*list(J()))>r::2])