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)
		}
		if fpoints[0] == fpoints[2] && fpoints[4] == fpoints[6] {
			fmt.Println("YES")
			continue
		}
		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: import math

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

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

    P = [int(100000*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 == 0:
        print("YES")
    else:
        print("NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(x) for x in input().split()]
    s1 = round((y2 - y1) / (x2 - x1), 10) if x1 != x2 else float('inf')
    s2 = round((y4 - y3) / (x4 - x3), 10) if x3 != x4 else float('inf')
    
    print("YES" if s1 == s2 else "NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(" "))
    if (y1 - y2) / (x1 - x2) == (y4 - y3)/ (x4 - x3): 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: # 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 abx / cdx == aby / cdy:
        print('YES')
    else:
        print('NO')

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

import sys
import os

N = int(input())

for i in range(N):
    ax, ay, bx, by, cx, cy, dx, dy = list(map(float, input().split()))
    AB = (bx - ax, by - ay)
    CD = (dx - cx, dy - cy)
    cross = AB[0] * CD[1] - AB[1] * CD[0]
    if cross == 0:
        print('YES')
    else:
        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 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")