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)
		}
		if fpoints[0] == fpoints[2] && fpoints[4] == fpoints[6] {
			fmt.Println("YES")
			continue
		}
		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

args = sys.argv

args = [int(float(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: 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 angle1 == angle2:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    p = list(map(float, input().split()))
    if p[2] == p[1]:
        print("YES" if p[4] == p[6] else "NO")
    else:
        print("YES" if (p[3] - p[1]) / (p[2] - p[0]) == (p[7] - p[5]) / (p[6] - p[4]) else "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")