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: # ????????????????????°??????
import sys

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    d1x = x2 - x1
    d1y = y2 - y1
    d2x = x4 - x3
    d2y = y4 - y3

    return d1x * d2y == d1y * d2x

    # if d1x != 0.0 and d2x != 0.0:
    #     #a1 = d1y / d1x
    #     #a2 = d2y / d2x
    #     #return a1 == a2
    #     return d1x * d2y == d1y * d2x

    # if d1x == 0.0 and d2x == 0.0:
    #     return True

    # return False

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

Python: N=int(input())
for _ in range(N):
    p=list(map(float,input().split()))
    a,b,c,d=map(lambda x:complex(*x),[p[:2],p[2:4],p[4:6],p[6:]])
    print(['NO','YES'][abs(((a-b).conjugate()*(c-d)).imag)<1e-11])

Python: 
if __name__ == '__main__':
    n = int(input())
    for _ 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:
            print("NO")
        elif x3 == x4:
            print("NO")
        else:
            if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3):
                print("YES")
            else:
                print("NO")

Python: import sys

input()
for i in sys.stdin.readlines():
    a = [float(x) for x in i.split()]
    ab = cd = 999999
    if a[2] - a[0] != 0:
        ab = (a[3] - a[1]) / (a[2] - a[0])
    if a[6] - a[4] != 0:
        cd = (a[7] - a[5]) / (a[6] - a[4])

    if ab == cd:
        print('YES')
    else:
        print('NO')

Python: n=int(input())
for _ in range(n):
    p=[float(i) for i in input().split()]
    if round((p[3]-p[1])/(p[2]-p[0]),5)==round((p[7]-p[5])/(p[6]-p[4]),5):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=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    try:
        ab=round((p[3]-p[1])/(p[2]-p[0]),5)
        cd=round((p[7]-p[5])/(p[6]-p[4]),5)
    except:
        ab=1
        cd=0
    if ab==cd:
        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")
    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 math
for i in range(int(raw_input())):
    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-8]

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

#x, y: direction vector
def is_parallel(x, y):
    if cross(x, y) == 0:
        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(x3, y3) - complex(x4, y4)    
    if is_parallel(a, b):
        print('YES')
    else:
        print('NO')

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:
        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())
    if (x1-x2)*(y3-y4)==abs((y1-y2)*(x3-x4)):
        print("YES")
    else:
        print("NO")

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-8

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: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())

    if x2 == x1 and x4 == x3:
        print('YES')
        continue

    if x2 == x1 or x4 == x3:
        print('NO')
        continue

    if abs((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: import sys
n = input()
for line in sys.stdin.readlines():
  l = [float(i) for i in line.split()]
  if (l[2]-l[0]) == (l[6]-l[4]) == 0:
    print('YES')
  elif (l[3]-l[1]) == (l[7]-l[5]) == 0:
    print('YES')
  elif (l[2]-l[0])*(l[7]-l[5]) == (l[3]-l[1])*(l[6]-l[4]) != 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 x1 == x2 or x3 == x4:
		print('YES' if x1 == x2 and x3 == x4 else 'NO')
	elif (y1 - y2)/(x1 - x2) == (y3 - y4)/(x3 - x4):
		print('YES')
	else:
		print('NO')

Python: n = int(input())
ans = []
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    if (ax - bx) != 0:
        a1 = (ay - by) / (ax - bx)
    else:
        a1 = float("inf")
    if (cx - dx) != 0:
        a2 = (cy - dy) / (cx - dx)
    else:
        a2 = float("inf")
    if a1 == a2:
        ans.append("YES")
    else:
        ans.append("NO")
print(*ans, sep="\n")

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: n=int(input())
for i in range(n):
    a=[float(i) for i in input().split()]
    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")