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 = input()
 
for n in range(N):
    data = list(map(float,input().split( )))
    slopes = []
    for i in range(2):
        _x1 = data.pop(0)
        _y1 = data.pop(0)
        _x2 = data.pop(0)
        _y2 = data.pop(0)
         
        if _x1 != _x2:
            slopes.append((_y1 - _y2)/(_x1 - _x2))
     
    if len(slopes) == 0:
        print("YES")
    elif len(slopes) == 1:
        print("NO")
    elif abs(slopes[0] - slopes[1]) < 1e-10:
        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 abs((y1 - y2) / (x1 - x2) - (y4 - y3)/ (x4 - x3)) < 1e-10: print("YES")
    else: print("NO")

Python: for _ in range(int(input())):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    print(['NO','YES'][abs((ay-by)*(dx-cx)-(ax-bx)*(dy-cy))<1e-10])

Python: # Edit: 2014/11/15
# Lang: Python3
# Time: 00.xxs

# File: pc0021.py


if __name__ == "__main__":

    nset = int(input())

    for i in range(0, nset):

        x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().strip("\n").split(" ")))
        vABx = x2 - x1
        vABy = y2 - y1
        vCDx = x4 - x3
        vCDy = y4 - y3

        mx = vCDx / vABx
        my = vCDy / vABy

        if mx == my:
            print("YES")
        else:
            print("NO")

#

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

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-11

def dot(a, b):
	return a.real*b.real + a.imag*b.imag

def cross(a, b):
	return a.real*b.imag - a.imag*b.real
	
def norm(a):
	return a.real**2 + a.imag**2
	
def project(line, p):
	base = line[1]-line[0]
	r = dot(p-line[0], base) / norm(base)
	return line[0] + base*r
	
def symmetric_Point(line, p):
	return p + 2*(project(line, p)-p)

def isParallelLL(line1, line2):
	t = cross(line1[1]-line1[0], line2[1]-line2[0])
	return -EPS <= t and t <= EPS


for _ in range(int(input())):
	p = list(map(float, input().split()))
	p1 = complex(p[0], p[1])
	p2 = complex(p[2], p[3])
	p3 = complex(p[4], p[5])
	p4 = complex(p[6], p[7])
	print('YES' if isParallelLL([p1,p2], [p3,p4]) else 'NO')

Python: def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if (x1 - x2) * (y3 - y4) != (x3 - x4) * (y1 - y2):
        print("NO")
        return
    else:
        print("YES")
        return

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: 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()))
    
    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)

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

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

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

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

Python: import math
N=range(int(raw_input()))
for i in N:
    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: import math

n = int(input())

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

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

    if var < 1e-10:
        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 == 0 or cdx == 0:
        if abx == 0 and cdx == 0:
            print('YES')
        else:
            print('NO')
    elif aby / abx == cdy / cdx:
        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())
    print('YES' if abs(x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1) < 1e-10 else 'NO')

Python: from decimal import Decimal as Dec

for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(Dec, input().split()))
    if x1 - x2 == x3 - x4 and y1 - y2 == y3 - y4:
        print('YES')
    else:
        print('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 a*d==c*b: print('YES')
    else: print('NO')

Python: cases = int(input())
i = 0
while i < cases:
   x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=round(dy1*dx2,5)
   l=round(dy2*dx1,5)
   print(k)
   print(l)
   if(k==l):
       print("YES")
   else:
       print("NO")
   i += 1

Python: N = int(input())
EPS = 1e-6
for i in range(N):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    if x2 == x1 and x4 == x3:
        print('YES')
        continue
    elif x2 == x1 or x4 == x3:
        print('NO')
        continue
    f = (y2 - y1) / (x2 - x1)
    g = (y4 - y3) / (x4 - x3)
    if g - EPS <= f <= g + EPS or -1.0 - EPS <= f * g <= -1.0 + EPS:
        print('YES')
    else:
        print('NO')

Python: n = int(input())
for i in range(n):
    p = list(map(float, input().split()))
    print("YES" if abs((p[3] - p[1]) * (p[2] - p[0]) - (p[7] - p[5]) * (p[6] - p[4])) < 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 y1 - y3 == y2 - y4 < 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()))
  s = x2 - x1
  t = y2 - y1
  u = x4 - x3
  v = y4 - y3;
  if (abs(s * v - t * u) < 1e-10) :
    print("YES")
  else :
    print("NO")

Python: E = 10 ** -20
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")