import sys def main(): data = sys.stdin.read().split() ints = [] for tok in data: try: ints.append(int(tok)) except ValueError: # skip non-integer tokens, e.g. "CASE" continue if not ints: return T = ints[0] out = [] idx = 1 for _ in range(T): Ax, Ay, Bx, By, Cx, Cy = ints[idx:idx+6] idx += 6 # tan(α + β) = (tan α + tan β) / (1 - tan α tan β) # Let tan α = Ay/Ax, tan β = By/Bx. # Numerator a = Ay*Bx + Ax*By # Denominator b = Ax*Bx - Ay*By # We want tan(α+β) == Cy/Cx <=> a/b == Cy/Cx # Cross-multiply (be careful if b==0 or Cx==0; this formula still works): a = Ay * Bx + Ax * By b = Ax * Bx - Ay * By # Check a * Cx == b * Cy if a * Cx == b * Cy: out.append("Yes") else: out.append("No") sys.stdout.write("\n".join(out)) if __name__ == "__main__": main()