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: n = int(input())
  
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = [ float(s) for s in input().split() ]
    diff = (x2-x1)*(y4-y3) - (x4-x3)*(y2-y1)
    if diff < 1e-10 and diff > -1*(1e-10):
        print('YES')
    else:
        print('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())
       try:
           m1 = (y2 - y1)/(x2 - x1)
           m2 = (y4 - y3)/(x4 - x3)
           if(m1 == m2):
               print("YES")
           else:
               print("NO")
       except ZeroDivisionError as err:
           print(err)
   i += 1

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

Python: 
import math

num = int(input())

for i in range(num):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(' '))
    aaa = (y1 - y2) * (x3 - x4)
    bbb = (y3 - y4) * (x1 - x2)
    if abs(aaa - bbb) <= 0:
        print('YES')
    else:
        print('NO')

Python: EPS = 10**-10
n = int(input())
pos = []

for _ in range(n):
  pos.append(list(map(float, input().split())))

for i in range(n):
  vec_ax = pos[i][2]-pos[i][0]
  vec_ay = pos[i][3]-pos[i][1]
  vec_bx = pos[i][6]-pos[i][4]
  vec_by = pos[i][7]-pos[i][5]
  if abs(vec_bx*vec_ay - vec_by*vec_ax) < EPS:
    print("YES")
  else:
    print("NO")

Python: # Edit: 2014/11/15
# Lang: Python3
# Time: 00.xxs

# File: pc0021.py


if __name__ == "__main__":

    nset = int(input())

    for i in range(0, nset):

        x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().strip("\n").split(" ")))
        vABx = x2 - x1
        vABy = y2 - y1
        vCDx = x4 - x3
        vCDy = y4 - y3

        mx = vCDx / vABx
        my = vCDy / vABy

        if abs(mx - my) < 1e-10:
            print("YES")
        else:
            print("NO")
        #print(mx-my)

#

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)/(y1 - y2) == (x3 - x4)/(y3 - y4):
		print('YES')
	else:
		print('NO')

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

Python: while True:
    try:
        a=[float(i) for i in input().split()]
    except:
        break
    print("YES" if (a[3]-a[1])/(a[2]-a[0])==(a[7]-a[5])/(a[6]-a[4]) else "NO")

Python: n=int(input())

for loop in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split(" ")]

    AB=[x2-x1,y2-y1]
    CD=[x4-x3,y4-y3]
    if AB[0]*CD[1]==AB[1]*CD[0]:
        print("YES")
    else:
        print("NO")

Python: import sys

# args = sys.argv

args = [int(float(line)) 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: def parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
    from fractions import Fraction
    x1, y1, x2, y2, x3, y3, x4, y4 = map(Fraction,(x1, y1, x2, y2, x3, y3, x4, y4))
    a1 = Fraction((y2-y1), (x2-x1)) if (x2-x1) != 0 else float("inf")
    a2 = Fraction((y4-y3), (x4-x3)) if (x4-x3) != 0 else float("inf")
    if a1 == a2:
        return "YES"
    else:
        return "NO"

if __name__ == "__main__":
    assert parallelism(0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 2.0, 1.0) == "YES", "sample1"
    assert parallelism(3.0, 2.0, 9.0, 6.0, 13.0, 5.0, 7.0, 9.0) == "NO", "sample2"
    assert parallelism(3.0, 2.0, 9.0, 2.0, 13.0, 5.0, 7.0, 5.0) == "YES", "horizontal line"
    assert parallelism(3.0, 2.0, 3.0, 6.0, 13.0, 5.0, 13.0, 9.0) == "YES", "vertical line"

    n = int(input())
    for _ in range(n):
        x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
        print(parallelism(x1, y1, x2, y2, x3, y3, x4, y4))

Python: def cross_product(a,b):
  return (a.conjugate()*b).imag
n = int(input())
for i in range(n):
    A = list(input().split())
    B = []
    for i in A:
        #print(i)
        if '.' not in i:
            #print('you',i)
            j = int(i)*(10**5)
        elif '-' not in i:
            #print('meiyou',i)
            p,q = i.split('.')
            j = int(p)*(10**5)+int(q)*10**(5-len(q))
        else:
            #print('youmeiyou',i)
            p,q = i.split('.')
            j = int(p)*(10**5)-int(q)*10**(5-len(q))
        #print(j)
        B.append(j)
    #print(B)
    u = complex(B[2]-B[0],B[3]-B[1])
    v = complex(B[6]-B[4],B[7]-B[5])
    #print(abs(cross_product(u,v)))
    if abs(cross_product(u,v)) == 0:
        print('YES')
    else:
        print('NO')

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

Python: import sys
f = sys.stdin

def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
    

n = int(f.readline())
for _ in range(n):
    xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    a, b, c, d = xy
    temp = (a - b) / (c - d)
    if  abs(temp.imag) < 0.001:
        temp = (a - b) / (a - c)
        if abs(temp.imag) < 0.001:
            print('NO')
        else:
            print('YES')
    else:
        print('NO')

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-7

def EQ(a, b):
	return True if abs(a - b) < EPS else False
	
n = int(input())
for i in range(n):
	ax1, ay1, ax2, ay2, bx1, by1, bx2, by2 = list(map(float, input().split()))
	f = False
	if EQ(ax1, ax2) and EQ(bx1, bx2): f = True
	elif EQ((ay2-ay1)*(bx2-bx1), (ax2-ax1)*(by2-by1)): f = True
	print('YES' if f else 'NO')

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

def is_parallel(x, y):
    if 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: import math
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')