import std; void main () { // とりあえず半径を出す // https://www.geogebra.org/m/MFRYfNPG // https://高校数学.net/bekutoru-menseki/ int Q = readln.chomp.to!int; auto input = readln.split.to!(int[]); auto A = tuple(input[0], input[1]); auto B = tuple(input[2], input[3]); auto C = tuple(input[4], input[5]); int bx = B[0]-A[0]; int by = B[1]-A[1]; int cx = C[0]-A[0]; int cy = C[1]-A[1]; double S = abs(1L*bx*cy - by*cx) / 2.; double r; if (S < 0.1) { r = max(dist(A, B), dist(A, C), dist(B, C)) / 2; } else { r = (dist(A, B)*dist(B, C)*dist(C, A)) / (4*S); } // 外心を出すのがだるい! // https://toy1972.hatenablog.com/entry/2021/11/05/063856 Tuple!(double, double) center; if (S < 0.1) { double M = max(dist(A, B), dist(A, C), dist(B, C)); if (dist(A, B) == M) { center = tuple((A[0]+B[0])/2., (A[1]+B[1])/2.); } else if (dist(A, C) == M) { center = tuple((A[0]+C[0])/2., (A[1]+C[1])/2.); } else { center = tuple((C[0]+B[0])/2., (C[1]+B[1])/2.); } } else { double sinA = dist(B, C) / (2*r); double sinB = dist(A, C) / (2*r); double sinC = dist(A, B) / (2*r); double degA = asin(sinA); double degB = asin(sinB); double degC = asin(sinC); double sin2A = sin(2*degA); double sin2B = sin(2*degB); double sin2C = sin(2*degC); double deno = sin2A + sin2B + sin2C; double X = A[0]*sin2A + B[0]*sin2B + C[0]*sin2C; double Y = A[1]*sin2A + B[1]*sin2B + C[1]*sin2C; center = tuple(X/deno, Y/deno); } const double eps = 0.1; foreach (_; 0..Q) { int X, Y; readln.read(X, Y); auto P = tuple(X.to!double, Y.to!double); if (dist(center, P) <= r + eps) { writeln("Yes"); } else { writeln("No"); } } } double dist (T) (Tuple!(T, T) A, Tuple!(T, T) B) { return sqrt(((A[0]-B[0])^^2 + (A[1]-B[1])^^2).to!double); } void read (T...) (string S, ref T args) { auto buf = S.split; foreach (i, ref arg; args) { arg = buf[i].to!(typeof(arg)); } }