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: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print(["NO","YES"][abs((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2)) < 1e-10])

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("No")
    else:
        print("Yes")

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

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

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**-11 <d < 10**-11:
        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-9])

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())
f=[]
for i in range(a):
    f.append(map(float,raw_input().split()))
for g in f:
    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]
        naiseki(x1,y1,x2,y2,x3,y3,x4,y4)
    except:
        print("NO")

Python: import math


def equal(x, y):
    return math.fabs(x - y) <= 10 ** (-8)


for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    d1 = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
    aco = (x1 - x2) / d1
    asi = (y1 - y2) / d1

    d2 = math.sqrt((x3 - x4) ** 2 + (y3 - y4) ** 2)
    bco = (x3 - x4) / d2
    bsi = (y3 - y4) / d2

    if equal(aco,bco) and  equal(bco,bsi):
        print('YES')
    else:
        print('NO')

Python: n = int(input())
for _ in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = [float(x) for x in input().split()]

    a = [x2-x1, y2-y1]
    b = [x4-x3, y4-y3]

    if a[0]*b[1] == a[1]*b[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 abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.000001:
            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 and aby == cdy:
        print('YES')
    else:
        print('NO')

Python: n = int(input())
cordinates = [list(map(float, input().split())) for _ in range(n)]

for cod in cordinates:
    x1, y1, x2, y2, x3, y3, x4, y4 = cod
    if abs((x2-x1) * (y4-y3) - (y2-y1) * (x4-x3)) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: from fractions import Fraction

def sroap(x1,y1,x2,y2):
	if x2 - x1 == 0:
		return float("inf")
	else:
		return Fraction(y2 - y1,x2 - x1)
		
N = int(input())
for n in range(N):
	Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 5),(map(float,input().split())))
	if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy):
		print("YES")
	else:
		print("NO")

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**-6 <d < 10**-6:
        print('YES')
    else:
        print('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])
    elif (d[0]==d[2] and d[4]==d[6]):
        r.extend([1])
    else:
        r.extend([0])
[print("YES") if i else print("NO") for i in r]

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

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-8:
        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: 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: def points2vec(points):
    return [points[0][i]-points[1][i] for i in range(2)]

def determinant(v1, v2):
    return v1[0] * v2[1] - v1[1] * v2[0]

n = int(input())
for _ in range(n):
    it = map(float, input().split())
    points = list(zip(it, it))
    v1 = points2vec(points[:2])
    v2 = points2vec(points[2:])
    print("YES" if determinant(v1, v2) == 0.0 else "NO")

Python: 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 vabx != 0:
    ratio = vcdx / vabx
    if vcdy == vaby * ratio:
      return True
    else:
      return False

  else:
    if vcdx == 0:
      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: for i in range(int(input())):
    s = list(map(float,input().split()))
    if s[1] - s[3] == 0 or s[5] - s[7] == 0:
        if s[1] - s[3] == s[5] - s[7] == 0:
            print('YES')
        else:
            print('NO')
    elif (s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7]) < 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())
    print('YES' if abs((y1-y2)*(x3-x4)-(y3-y4)*(x1-x2))<1e-10 else 'NO')

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