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: # 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-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: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-7

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

Python: r=[]
for i in range(int(input())):
    d=[float(i) for i in input().split()]
    if d[0]-d[2] != 0 and d[4]-d[6] != 0:
        a=(d[1]-d[3])/(d[0]-d[2])
        b=(d[5]-d[7])/(d[4]-d[6])
        if a==b:r.extend([1])
        else:r.extend([0])
    else:
        r.extend([0])
[print("YES") if i else print("NO") for i in r]

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: 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 x2 == 0 or x4 == 0:
        if x2 == 0 and x4 == 0:
            print('YES')
        else:
            print('NO')
    else:
        if y2 / x2 == y4 / x4:
            print('YES')
        else:
            print('NO')

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 (b-d)/(a-c) - (f-h)/(e-g) < 1e-10 else "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")

Python: for i in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4=map(lambda x: int(100000*float(x)),input().split())
    x12=x1-x2
    y12=y1-y2
    x34=x3-x4
    y34=y3-y4
    if x12*y34==y12*x34:
        print("YES")
    else:
        print("NO")

Python: # -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    k1 = (y2-y1)/(x2-x1)
    k2 = (y4-y3)/(x4-x3)
    if abs(k1-k2) < 1e-10:
        print('YES')
    else:
        print('NO')

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

Python: n = int(input())
for line in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    d = (x2 - x1)*(y4 - y3) - (y2 - y1)*(x4 - x3)
    if -10**-5 <d < 10**-5:
        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: import sys
import math

n = int(input())
for s in range(n):
    pos = list(map(float, input().split()))
    if pos[0] == pos[2] or pos[4] == pos[6]:
        angle1 = 0
        angle2 = 0
    else:
        angle1 = (pos[3]-pos[1])/(pos[2]-pos[0])
        angle2 = (pos[7]-pos[5])/(pos[6]-pos[4])
    if angle1 == angle2 and angle1 != 0:
        print("YES")
    else:
        print("NO")

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

Python: ABs=[]
CDs=[]
n = int(input())
for i in range(n):
    x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split())
    AB = [x_2 - x_1, y_2 - y_1]
    CD = [x_4 - x_3, y_4 - y_3]
    ABs.append(AB)
    CDs.append(CD)
for i in range(n):
    if abs(ABs[i][0]*CDs[i][1]-ABs[i][1]*CDs[i][0])<10**(-10):
        print("YES")
    else:
        print("NO")

Python: count = int(input())
for i in range(count):
    x = list(map(float ,input().split()))
    x1=x[2]-x[0]
    y1=x[3]-x[1]
    x2=x[6]-x[4]
    y2=x[7]-x[5]
    if abs(x1*y2-x2*y1)<=1e-10:
        print("YES")
    else:
        print("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] or t[0]):
        print("YES")
        continue
    if s[1]/s[0] == t[1]/t[0]:
        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 abs(cross) < 1e-10:
        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())
    abx = x2 - x1
    aby = y2 - y1
    cdx = x4 - x3
    cdy = y4 - y3
    if abs(aby * cdx) < 1e-10 and abs(cdy * abx) < 1e-10:
        print(['NO', 'YES'][abs(abx - cdx) < 1e-10 or abs(aby - cdy) < 1e-10])
    elif abs(aby * cdx - cdy * abx) < 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 < 0.0000000001:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
	line = list(map(float,input().split()))
	AB = (line[3] - line[1]) / (line[2] - line[0])
	CD = (line[7] - line[5]) / (line[6] - line[4])
	if round(AB - CD,8) == 0:
		print("YES")
	else:
		print("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
    temp = (a - b) / (c - d)
    if  abs(temp.imag) < 0.001:
        if a - c == 0:
            print('NO')
        else:
            temp = (a - b) / (a - c)
            if abs(temp.imag) < 0.001:
                print('NO')
            else:
                print('YES')
    else:
        print('NO')