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: def cross(x, y):
    return (x.conjugate() * y).imag

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-6:
        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())
E = 10**-10
for _ in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = [float(i) for i in input().split()]
    if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < E:
        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')
	if abs((asy-aey)*(bsx-bex)-(asx-aex)*(bsy-bey)) == 0: print('YES')
	else: print('NO')

Python: def calc(a):
    i1 = (a[3] - a[1]) / (a[2] - a[0])
    i2 = (a[7] - a[5]) / (a[6] - a[4])
    if i1 == i2:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    N = int(input())
    a = []
    for i in range(0, N):
        a.append(list(map(float, input().split())))
        calc(a[i])

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")
	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: for _ in range(int(input())):
  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

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = int(input())
for l in range(N):

    P = [float(i) for i in input().split()]
    x1,y1,x2,y2,x3,y3,x4,y4 = P
    xa = x2-x1
    ya = y2-y1
    xb = x4-x3
    yb = y4-y3
    if xa*yb-ya*xb < 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((x1 - x2) / (y1 - y2)) == abs((x3 - x4) / (y3 - y4)) 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)) <= 10**(-10): print("YES")
    else: print("NO")

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

Python: from math import isclose

n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if isclose((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1), 0.0):
        print("YES")
    else:
        print("NO")

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    info=list(map(lambda x:int(x*10**5),info))
    if info[2]==info[0]:
        if info[6]==info[4]:
            print("YES")
        else:
            print("NO")
    elif info[6]==info[4]:
        if info[2]==info[0]:
            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: # coding: utf-8

n = int(raw_input())
for i in range(n):
	data = map(float, raw_input().split(' '))
	x1 = data[0]
	y1 = data[1]
	x2 = data[2]
	y2 = data[3]
	x3 = data[4]
	y3 = data[5]
	x4 = data[6]
	y4 = data[7]

	try:
		if (x1 == x2) and (x3 == x4):
			print("YES")
		elif (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3):
			print("YES")
		else:
			print("NO")
	except ZeroDivisionError:
		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
    print('YES' if dx12 * dy34 - dy12 * dx34 < 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())
    if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10:
        print("YES")
    else:
        print("NO")

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

Python: for _ in[0]*int(input()):
 a,b,c,d,e,f,g,h=map(float,input().split())
 print(['NO','YES'][(a-c)*(f-h)-(e-g)*(b-d)==0])

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: num=int(input())
for i in range(num):
   print(input())

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,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=dy1*dx2
   l=dy2*dx1
   if( k==l ):
       print("YES")
   else:
       print("NO")
   i += 1

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

Python: 

n=int(input())

for i in range(n):
    xy=list(map(float,input().split(" ")))
    X1=xy[2]-xy[0]
    Y1=xy[3]-xy[1]
    X2=xy[6]-xy[4]
    Y2=xy[7]-xy[5]
    area=X1*X2-Y1*Y2
    if abs(area)<10e-12:
        print("YES")
    else:
        print("NO")

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