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: num = int(input())

EPS = 0.00000000001

for _ in range(num):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(x) for x in input().split()]
    
    abx = x2 - x1
    aby = y2 - y1
    cdx = x4 - x3
    cdy = y4 - y3
    # abx : aby = cdx : cdy
    # aby * cdx - abx * cdy = 0 ( < EPSilon)
    
    if abs(aby * cdx - abx * cdy) < EPS:
        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(input())

for i in range(a):
    f = map(float,raw_input().split())
    try:
        g=f
        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: for _ in range(int(input())):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    print(['NO','YES'][(by-ay)/(bx-ax)==(dy-cy)/(dx-cx)])

Python: import math
for i in range(int(raw_input())):
    a,w,b,x,c,y,d,z=map(float, raw_input().split())
    print ["NO","YES"][abs((w-x)*(c-d)-(y-z)*(a-b))<1e-10]

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    try:
        i = (b-d)/(a-c)
    except:
        i = 90

    try:
        j = (f-h)/(e-g)
    except:
        j = 90
    
    if i == j:
        print("Yes")
    else:
        print("No")

input()

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

Python: # -*- coding:utf-8 -*-

def main():
    for i in range(int(input())):
        x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())

        if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1))==0:
            print("YES")
        else:
            print("NO")
    
        
if __name__ == '__main__':
    main()

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

Python: def cross(x, y):
    return (x.conjugate() * y).imag

#x, y: direction vector
def is_parallel(x, y):
    if cross(x, y) == 0:
        return True
    return False

n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    a = complex(x2, y2) - complex(x1, y1)
    b = complex(x4, y4) - complex(x3, y3)    
    if is_parallel(a, b):
        print('YES')
    else:
        print('NO')

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    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: E = 10 ** -10
def check(lst):
  x1, y1, x2, y2, x3, y3, x4, y4 = lst
  vabx, vaby = x2 - x1, y2 - y1
  vcdx, vcdy = x4 - x3, y4 - y3
  if abs(vabx * vcdy - vcdx * vaby) < E:
    return True
  else:
    return False

n = int(input())
for _ in range(n):
  plst = list(map(float, input().split()))
  print("YES" if check(plst) else "NO")

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    s = [x2-x1, y2-y1]
    t = [x4-x3, y4-y3]
    if not (s[0] and t[0]):
        if not (s[0] or t[0]):
            print("YES")
        else:
            print("NO")
        continue
    if s[1]/s[0] == t[1]/t[0]:
        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((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.00001:
            print("YES")
        else:
            print("NO")

Python: # Aizu Problem 0021: Parallelism
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


N = int(input())
for n in range(N):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(_) for _ in input().split()]
    det = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)
    print("YES" if det == 0 else "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: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-7

def EQ(a, b):
	return abs(a - b) < EPS
	
n = int(input())
for i in range(n):
	ax1, ay1, ax2, ay2, bx1, by1, bx2, by2 = list(map(float, input().split()))
	f = False
	if EQ(ax1, ax2) and EQ(bx1, bx2): f = True
	elif EQ((ay2-ay1)*(bx2-bx1), (ax2-ax1)*(by2-by1)): f = True
	print('YES' if f else 'NO')

Python: # ????????????????????°??????
import sys
from decimal import Decimal

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

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

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = Decimal(data[0])
        y1 = Decimal(data[1])
        x2 = Decimal(data[2])
        y2 = Decimal(data[3])
        x3 = Decimal(data[4])
        y3 = Decimal(data[5])
        x4 = Decimal(data[6])
        y4 = Decimal(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 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: 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")
            continue
        else:
            print("NO")
            continue
    elif Date[2] == Date[0] and Date[6] == Date[4]:
        print("YES")

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)) < 1e-10:
        print("YES")
    else:
        print("NO")

Python: n = int(raw_input())
for i in range(n):
  p = map( float, raw_input().split() )
  flag = ( p[ 1 ] - p[ 0 ] ) * ( p[ 7 ] - p[ 6 ] ) == ( p[ 3 ] - p[ 2 ] ) * ( p[ 5 ] - p[ 4 ] )
  print ( flag and 'YES' ) or 'NO'