Go: package main

import "fmt"

func abs(x float64) float64 {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n int
	var x1, y1, x2, y2, x3, y3, x4, y4 float64
	fmt.Scan(&n)
	for i := 0 ; i < n; i++ {
		fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)
		if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: for _ in range(int(input())):
  x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
  if abs((x2 - x1)*(y4 - y3) - (y2 - y1)*(x4 - x3)) < 1e-10:
     print("YES")
  else:
     print("NO")

Python: import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = int(input())
for l in range(N):

    P = [float(i) for i in input().split()]
    x1,y1,x2,y2,x3,y3,x4,y4 = P
    xa = x2-x1
    ya = y2-y1
    xb = x4-x3
    yb = y4-y3
    if xa*yb-ya*xb < 1e-10:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print("YES" if abs((x1 - x2) / (y1 - y2)) == abs((x3 - x4) / (y3 - y4)) else "NO")

Python: n = int(input())
for _ in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1)) <= 10**(-10): print("YES")
    else: print("NO")

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    info=list(map(lambda x:int(x*10**10),info))
    if info[2]==info[0]:
        if info[6]==info[4]:
            print("YES")
        else:
            print("NO")
    elif info[6]==info[4]:
        if info[2]==info[0]:
            print("YES")
        else:
            print("NO")
    else:
        if (info[3]-info[1])/(info[2]-info[0])==(info[7]-info[5])/(info[6]-info[4]):
            print("YES")
        else:
            print("NO")

Python: n = int(input())
for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()]
  if x2 == x1:
    if x4 == x3:
      print("YES")
    else:
      print("NO")
  elif x4 == x3:
    print("NO")
  else:
    print("YES" if (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-5 else "NO")

Python: from math import isclose

n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if isclose((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1), 0.0):
        print("YES")
    else:
        print("NO")

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    info=list(map(lambda x:int(x*10**5),info))
    if info[2]==info[0]:
        if info[6]==info[4]:
            print("YES")
        else:
            print("NO")
    elif info[6]==info[4]:
        if info[2]==info[0]:
            print("YES")
        else:
            print("NO")
    else:
        if (info[3]-info[1])/(info[2]-info[0])==(info[7]-info[5])/(info[6]-info[4]):
            print("YES")
        else:
            print("NO")

Python: # coding: utf-8

n = int(raw_input())
for i in range(n):
	data = map(float, raw_input().split(' '))
	x1 = data[0]
	y1 = data[1]
	x2 = data[2]
	y2 = data[3]
	x3 = data[4]
	y3 = data[5]
	x4 = data[6]
	y4 = data[7]

	try:
		if (x1 == x2) and (x3 == x4):
			print("YES")
		elif (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3):
			print("YES")
		else:
			print("NO")
	except ZeroDivisionError:
		print("NO")

Python: n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    dx12, dx34, dy12, dy34 = x1 - x2, x3 - x4, y1 - y2, y3 - y4
    print('YES' if dx12 * dy34 - dy12 * dx34 < 1e-10 else 'NO')

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10:
        print("YES")
    else:
        print("NO")

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    
    if (a-c)*(f-h) - (b-d)*(e-g):
        print("No")
    else:
        print("Yes")

Python: for _ in[0]*int(input()):
 a,b,c,d,e,f,g,h=map(float,input().split())
 print(['NO','YES'][(a-c)*(f-h)-(e-g)*(b-d)==0])

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    if (b-d)/(a-c) == (f-h)/(e-g):
        print("Yes")
    else:
        print("No")

Python: num=int(input())
for i in range(num):
   print(input())

Python: import sys
cases = int(input())
i = 0
while i <= cases:
   #for line in sys.stdin.readlines():
   x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=dy1*dx2
   l=dy2*dx1
   if( k==l ):
       print("YES")
   else:
       print("NO")
   i += 1

Python: for i in range(int(input())):
  a,b,c,d,e,f,g,h = map(float,input().split())
  if a == c:
    print("YES" if e == g else "NO")
  elif e == g:
    print("NO")
  else:
    print("YES" if abs((b-d)/(a-c) - (f-h)/(e-g)) < 1e-10 else "NO")

Python: 

n=int(input())

for i in range(n):
    xy=list(map(float,input().split(" ")))
    X1=xy[2]-xy[0]
    Y1=xy[3]-xy[1]
    X2=xy[6]-xy[4]
    Y2=xy[7]-xy[5]
    area=X1*X2-Y1*Y2
    if abs(area)<10e-12:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    Date = list(map(float,input().split()))
    
    if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]):
        print("YES")
    else:
        print("NO")

Python: # ????????????????????°??????
import sys

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    d1x = x2 - x1
    d1y = y2 - y1
    d2x = x4 - x3
    d2y = y4 - y3

    return d1x * d2y == d1y * d2x

    # if d1x != 0.0 and d2x != 0.0:
    #     #a1 = d1y / d1x
    #     #a2 = d2y / d2x
    #     #return a1 == a2
    #     return d1x * d2y == d1y * d2x

    # if d1x == 0.0 and d2x == 0.0:
    #     return True

    # return False

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

Python: N=int(input())
for _ in range(N):
    p=list(map(float,input().split()))
    a,b,c,d=map(lambda x:complex(*x),[p[:2],p[2:4],p[4:6],p[6:]])
    print(['NO','YES'][abs(((a-b).conjugate()*(c-d)).imag)<1e-11])

Python: 
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        if x1 == x2 and x3 == x4:
            print("YES")
        elif x1 == x2:
            print("NO")
        elif x3 == x4:
            print("NO")
        else:
            if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3):
                print("YES")
            else:
                print("NO")

Python: import sys

input()
for i in sys.stdin.readlines():
    a = [float(x) for x in i.split()]
    ab = cd = 999999
    if a[2] - a[0] != 0:
        ab = (a[3] - a[1]) / (a[2] - a[0])
    if a[6] - a[4] != 0:
        cd = (a[7] - a[5]) / (a[6] - a[4])

    if ab == cd:
        print('YES')
    else:
        print('NO')

Python: n=int(input())
for _ in range(n):
    p=[float(i) for i in input().split()]
    if round((p[3]-p[1])/(p[2]-p[0]),5)==round((p[7]-p[5])/(p[6]-p[4]),5):print("YES")
    else:print("NO")