Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	for i := 0; i < n; i++ {
		scanner.Scan()
		points := strings.Split(scanner.Text(), " ")
		fpoints := make([]float64, 0)
		for _, v := range points {
			tmp, _ := strconv.ParseFloat(v, 64)
			fpoints = append(fpoints, tmp)
		}
		a := (fpoints[1]-fpoints[3])/(fpoints[0]-fpoints[2])
		b := (fpoints[5]-fpoints[7])/(fpoints[4]-fpoints[6])
		if a == b {
			fmt.Println("YES")
		} else {
			fmt.Println("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 abs(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())
    print("YES" if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4) else "NO")

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

n = int(input())
for i in range(n):
	asx, asy, aex, aey, bsx, bsy, bex, bey = list(map(float, input().split()))
#	if (asx == aex and asy == aey) or (bsx == bex and bsy == bey): print('NO')
	if abs((asy-aey)*(bsx-bex)-(asx-aex)*(bsy-bey)) == 0: 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 y1 == y3 and y2 == y4:
        print("YES")
    else:
        print("NO")

Python: def main():
    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")

if __name__ == '__main__':
    main()

Python: for i in range(int(input())):
	ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
	if ax==bx or cx==dx:
		print("YES" if ax==bx and cx==dx and ay!=by and cy!=dy else "NO")
	else:
		print("YES" if abs((ay-by)/(ax-bx)-(cy-dy)/(cx-dx))<1e-10 else "NO")

Python: N = int(input())
for i 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: num = int(input())
l = []
for i in range(num):
    lst = list(map(float, input().split()))
    x1, y1 = lst[0], lst[1]
    x2, y2 = lst[2], lst[3]
    x3, y3 = lst[4], lst[5]
    x4, y4 = lst[6], lst[7]

    d = (x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)
    k = abs(d)

    if k <= 1e-11:
        l.append('YES')
    else:
        l.append('NO')

for i in l:
    print(i)

Python: def gaiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10:
        print("YES")
    else:
        print("NO")
a = int(input())

for i in range(a):
    g=(map(float,raw_input().split()))
    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]
        gaiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    except:
        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")
    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 = (eval(input()))
for _ in range(N):
	x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()]
	if (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4):
		print('YES')
	else:
		print('NO')

Python: for i in range(int(input())):
    l = list(map(float,input().split()))
    ab, cd = (l[2]-l[0])/(l[3]-l[1]), (l[6]-l[4])/(l[7]-l[5])
    if ab==cd: print('YES')
    else: print('NO')

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

    if x1 == x2:
        ans = x3 == x4
    elif x3 == x4:
        ans = False
    else:
        ans = (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3)

    print("YES") if ans else print("NO")

Python: import sys

lines = sys.stdin.readlines()
size = int(lines[0])
data = lines[1:len(lines)]
for line in data:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(float(i))
    x = []
    x.append(inp[0])
    x.append(inp[2])
    x.append(inp[4])
    x.append(inp[6])
    y = []
    y.append(inp[1])
    y.append(inp[3])
    y.append(inp[5])
    y.append(inp[7])
    if x[1]==x[0] and x[3]==x[2]:
        print ("YES")
    elif x[1]==x[0] or x[3]==x[2]:
        print ("NO")
    else:
        tilt1 = (y[1]-y[0])/(x[1]-x[0])
        tilt2 = (y[3]-y[2])/(x[3]-x[2])
        if tilt1==tilt2:
            print ("YES")
        else:
            print ("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)<=1e-12:
        print("YES")
    else:
        print("NO")

Python: n=int(input())
for nn in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=list(map(float,input().split()))
    if x1==x2 and x3==x4:
        print("YES")
    else:
        if (y2-y1)/(x2-x1)==(y4-y3)/(x4-x3):
            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)*1.0 == (y4-y3)/(x4-x3)*1.0:
			print("YES")
		else:
			print("NO")
	except ZeroDivisionError:
		print("NO")

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

Python: #! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']

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

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
    if (a - b) / abs(a - b) - (c - d) / abs(c - d) == 0:
        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 abs(det) < 1e-5  else "NO")

Python: for i in range(int(input())):
    l = list(map(float,input().split()))
    a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5]
    if b==0 or d==0: continue
    if a/b==c/d: print('YES')
    else: print('NO')

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

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-9:
        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')