Go: package main

import (
        "fmt"
        "math/big"
)

func main() {
        var x1, x2, x3, x4, y1, y2, y3, y4 big.Float
        var n int
        fmt.Scanf("%d", &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)
                var lx, ly, mx, my, mul1, mul2, sub, zz big.Float
                lx.Sub(&x2, &x1)
                ly.Sub(&y2, &y1)
                mx.Sub(&x4, &x3)
                my.Sub(&y4, &y3)
                mul1.Mul(&lx, &my)
                mul2.Mul(&ly, &mx)
                sub.Sub(&mul1, &mul2)
                zz.SetFloat64(0.0)

                if sub.Cmp(&zz) == 0 {
                        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())
    if abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)) < 1e-8:
        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 abs(angle1 - angle2) <= 1e-10 and angle1 + angle0 != 0:
        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 x1==0:
        if x2==0:
            print("YES")
        else:
            print("NO")
    else:
        if y1/x1==y2/x2:
            print("YES")
        else:
            print("NO")

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

Python: # -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if x1 == x2 and x4 == x3:
        print('YES')
        return 0
    elif x1 == x2 or x3 == x4:
        print('NO')
        return 0
    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: import sys

args = sys.argv

args = [int(a) for a in args]


class Point():
  def __init__(self,x,y):
      self.x = x
      self.y = y

  def __sub__(self,oth):
    self.x = self.x - oth.x
    self.y = self.y - oth.y
    return Point(self.x,self.y)

  def __str__(self):
    return "%s(%r)" %(self.__class__,self.__dict__)

for _ in range(args[0]):
  if _ == 0:
    pass
  else:
    A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
    tmp = B - A
    tmp2 = C - D
    tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
    if tmp3 == 0:
      print("YES")
    else:
      print("NO")

Python: 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)) < 1e-10:
            print("YES")
        else:
            print("NO")

Python: n = int(input())
for i in range(n):
	line = list(map(float,input().split()))
	if round(line[2] - line[0], 6) == 0:
		if round(line[6] - line[4], 6) == 0:
			if round(line[6] - line[0],6) == 0:
				print("NO")
			else:
				print("YES")
		else:
			print("NO")
	elif round(line[6] - line[4], 6) == 0:
		print("NO")
	else:
		AB = (line[3] - line[1]) / (line[2] - line[0])
		CD = (line[7] - line[5]) / (line[6] - line[4])
		if round(line[4] - line[2], 6) == 0:
			BC = 10000000000
		else:
			BC = (line[5] - line[3]) / (line[4] - line[2])
		if round(AB - CD, 8) == 0 and round(AB - BC,8) != 0:
			print("YES")
		else:
			print("NO")

Python: import sys

def cross(a, b):
    return a.real * b.imag - a.imag * b.real
 
n = sys.stdin.readline()
for line in sys.stdin:
    a, b, c, d = [x + y * 1j for x, y in zip(* [map(float, line.split())] * 2)]
    print('YES' if abs(cross(a - b, c - d)) < 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 abs((x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1)) < 1e-10 else 'NO')

Python: n=int(input())
for _ in range(n):
    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: import sys

n = int(input())
for s in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().strip().split())
    angle1 = (y2-y1)/(x2-x1)
    angle2 = (y4-y3)/(x4-x3)
    if angle1 == angle2:
        print("YES")
    else:
        print("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')
	elif abs((asy-aey)*(bsx-bex)-(asx-aex)*(bsy-bey)) < 1e-8: print('YES')
	else: print('NO')

Python: def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if (x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2) > 1e-10:
        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: n = int(input())
for i in range(n):
    a,e,b,f,c,g,d,h=list(map(float,input().split()))
    print("YES" if abs((b-a)*(d-c)-(h-g)*(f-e)) < 1e-10 else "NO")

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[i][0]*CDs[i][1]==ABs[i][1]*CDs[i][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
    if dy12 and dy34:
        print('YES' if dx12 / dy12 == dx34 / dy34 else 'NO')
    elif dx12 and dx34:
        print('YES' if dy12 / dx12 == dy34 / dx34 else 'NO')
    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 k1 == k2:
        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: 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 x1==0.00000:
        if x2==0.00000:
            print("YES")
        else:
            print("NO")
    elif y1==0.00000:
        if y2==0.00000:
            print("YES")
        else:
            print("NO")
    else:
        if format(y1/x1,'.5f')==format(y2/x2,'.5f'):
            print("YES")
        else:
            print("NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float,input().split()))
    if x1 - x2 == x3 - x4 and y1 - y2 == y3 - y4:
        print('YES')
    else:
        print('NO')