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: import sys
cases = int(input())
i = 0
while i < cases:
   for line in sys.stdin.readlines():
       x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,line.split())
       m1 = (y2 - y1)/(x2 - x1)
       m2 = (y4 - y3)/(x4 - x3)
       if(m1 == m2):
           print("YES")
       else:
           print("NO")
   i += 1

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if x1 == x2 and x3 == x4:
        print("YES")
    elif x1 == x2 or x3 == x4:
        print("NO")
    elif (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3):
        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 cross(a, b):
    return a.real * b.imag - a.imag * b.real
 
n = f.readline()
for line in f:
    a, b, c, d = [x + y * 1j for x, y in zip(* [map(float, line.split())] * 2)]
    print('YES' if cross(a - b, c - d) == 0.0 else 'NO')

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

Python: n = int(raw_input)
for i in range(n):
  p = map( float, raw_input().split() )
  flag = ( p[ 1 ] - p[ 0 ] ) * ( p[ 7 ] - p[ 6 ] ) == ( p[ 3 ] - p[ 2 ] ) * ( p[ 5 ] - p[ 4 ] )
  print ( flag and 'YES' ) or 'NO'

Python: EPS = 1e-10
for q in range(int(input())):
    l = list(map(float, input().split()))
    if abs((l[3] - l[1]) * (l[6] - l[4]) - (l[7] - l[5]) * (l[2] - l[0])) < EPS:
        print('YES')
    else:
        print('NO')

Python: import sys

# args = sys.argv

args = [int(float(a)) for line in sys.stdin]


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 int(tmp3) == 0:
      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 abs(x1 - x2) < 1e-10 or abs(x3 - x4) < 1e-10:
		print('YES' if abs(x1 - x2) < 1e-10 and abs(x3 - x4) < 1e-10 else 'NO')
	elif abs((y1 - y2)/(x1 - x2) - (y3 - y4)/(x3 - x4)) < 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())
    dx12, dx34, dy12, dy34 = x1 - x2, x3 - x4, y1 - y2, y3 - y4
    if not ((dx12 or dy12) and (dx34 or dy34)):
        print('NO')
    else:
        print('YES' if dx12 * dy34 == dy12 * dx34 else 'NO')

Python: while True:
    try:
        a=[float(i) for i in input().split()]
    except:
        break
    dx1=a[2]-a[0]
    dy1=a[3]-a[1]
    dx2=a[6]-a[4]
    dy2=a[7]-a[5]
    if dx1==0 or dx2==0:
        if dx1==0 and dx2==0:
            print("YES")
        else:
            print("NO")
    elif dy1/dx1==dy2/dx2:
        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], 2) == 0:
		if round(line[6] - line[4], 2) == 0:
			print("YES")
		else:
			print("NO")
	elif round(line[6] - line[4], 2) == 0:
		pass
	else:
		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 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: 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)<=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())
    if abs((x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)) < 1e-10: print("YES")
    else: print("NO")

Python: import math

epsilon = 1e-10

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

def run():
    N = int(input())
    for _ in range(N):
        x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
        _v1 = (x2 - x1, y2 - y1)
        _v2 = (x4 - x3, y4 - y3)
        grad = get_grad(_v1, _v2)
        if abs(grad) < epsilon:
            print('YES')
        else:
            print('NO')

if __name__ == '__main__':
    run()

Python: 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")

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)) < 10e-5])

Python: import sys
import math

n = int(input())
for s in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().strip().split())
    angle1 = fabs(y2-y1)/fabs(x2-x1)
    angle2 = fabs(y4-y3)/fabs(x4-x3)
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

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

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-10:
        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 j in range(n):
    p=[float(i) for i in input().split()]
    if p[2]-p[0]==0 or p[6]-p[4]==0:
        print(["YES","NO"][bool(p[2]-p[0]+p[6]-p[4])])
    else:
        print(["YES","NO"][bool(((p[3]-p[1])/(p[2]-p[0]))-((p[7]-p[5])/(p[6]-p[4])))])

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    det = abs((y1-y2) * (x3-x4) - (x1-x2) * (y3-y4))
    if det<1e-12 :
        print("YES")
    else:
        print("NO")

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

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-10:
        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')