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: 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 dy12 and dy34:
        print('YES' if dx12 / dy12 == dx34 / dy34 else 'NO')
    elif dx12 and dx34:
        print('YES' if dy12 / dx12 == dy34 / dx34 else 'NO')
    else:
        print('NO')

Python: # -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    k1 = (y2-y1)/(x2-x1)
    k2 = (y4-y3)/(x4-x3)
    if k1 == k2:
        print('YES')
    else:
        print('NO')

n = int(input())

for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    check_para(x1,y1,x2,y2,x3,y3,x4,y4)

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 x1==0.00000:
        if x2==0.00000:
            print("YES")
        else:
            print("NO")
    elif y1==0.00000:
        if y2==0.00000:
            print("YES")
        else:
            print("NO")
    else:
        if format(y1/x1,'.5f')==format(y2/x2,'.5f'):
            print("YES")
        else:
            print("NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float,input().split()))
    if x1 - x2 == x3 - x4 and y1 - y2 == y3 - y4:
        print('YES')
    else:
        print('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))