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: import sys
f = sys.stdin

def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
    

n = int(f.readline())
for _ in range(n):
    xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    a, b, c, d = xy
    if a.real > b.real:
        a, b = b, a
    if c.real > d.real:
        c, d = d, c
    temp = (a - b) / abs(a - b) - (c - d) / abs(c - d) 
    if  abs(temp.real) < 0.01 and abs(temp.imag)  < 0.01:
        print('YES')
    else:
        print('NO')

Python: N = eval(input())
for _ in range(N):
	x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()]
	if (x1 == x2 and x3 == x4) or (y1 == y2 and y3 == y4):
		print('YES')
	elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4):
		print('YES')
	else:
		print('NO')

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

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

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

Python: import math
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0:
        print("YES")
    else:
        print("NO")
a = int(raw_input())
f=[]
for i in range(a):
    f.append(map(float,raw_input().split()))
for g in f:
    try:
        x1=g[0]
        y1=g[1]
        x2=g[2]
        y2=g[3]
        x3=g[4]
        y3=g[5]
        x4=g[6]
        y4=g[7]
        naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    except:
        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()]
    for i in range(len(P)):
        P[i] = int(P[i]*100000)

    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 == 0:
        print("YES")
    else:
        print("NO")

Python: def main():
    n = int(input())

    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    if (y2-y1)/(x2-x1) == (y4 - y3)/(x4 -x3):
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    main()

Python: from fractions import Fraction
'''
def judgeX0(Ax,Ay,Bx,By,Cx,Cy,Dx,Dy):
	ABx = Bx - Ax
	CDx = Dx - Cx
	if ABx == 0:
		if CDx == 0:
			if Cx == Bx:
				return 0
			else:
				return 2
		else:
			return 0
	elif CDx == 0:
		return 0
	else:
		return 1
'''
def sroap(x1,y1,x2,y2):
	if x2 - x1 == 0:
		return float("inf")
	else:
		return Fraction(y2 - y1,x2 - x1)
		
N = int(input())
for n in range(N):
	Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 6),(map(float,input().split())))
	if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy):
		if sroap(Ax,Ay,Bx,By) == sroap(Bx,By,Cx,Cy):
			print("NO")
		else:
			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) < 10e-10:
        print("No")
    else:
        print("Yes")

Python: n=int(input())

ESP=1e-10

for t in range(n):
  s=input()
  item=s.split()
  x=[]
  y=[]
  for i in range(4):
    x.append(float(item[i*2]))
    y.append(float(item[i*2+1]))
  if abs(x[0]-x[1])<=ESP or abs(x[2]-x[3])<=ESP:
    if abs(x[0]-x[1])<=ESP and abs(x[2]-x[3])<=ESP:
      print("YES")
    else:
      print("NO")
  else:
    if abs((y[0]-y[1])/(x[0]-x[1])-(y[2]-y[3])/(x[2]-x[3]))<=ESP:
      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())
    if x1 == x2 and y1 == y2 or x3 == x4 and y3 == y4:
        print('YES')
    else:
        print('YES' if abs(x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1) < 1e-10 else 'NO')

Python: # coding=utf-8

n = int(input())
for i in range(n):
    points_list = list(map(float, input().split()))
    abx = points_list[2] - points_list[0]
    aby = points_list[3] - points_list[1]
    cdx = points_list[6] - points_list[4]
    cdy = points_list[7] - points_list[5]

    if aby == 0 or cdy == 0:
        if aby == 0 and cdy == 0:
            print('YES')
        else:
            print('NO')
    elif abx / aby == cdx / cdy:
        print('YES')
    else:
        print('NO')

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

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

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

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

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

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

Python: n = int(input())
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay-by)/(ax-bx)
    a2 = (cy-dy)/(cy-dy)
    if a1 == a2:
        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())
    if (x2-x1)*(y4-y3) - (y2-y1)*(x4-x3) == 0:
        print("YES")
    else:
        print("NO")