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: # 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 mx == my:
            print("YES")
        else:
            print("NO")

#

Python: n=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    ab=round((p[3]-p[1])/(p[2]-p[0]),5)
    cd=round((p[7]-p[5])/(p[6]-p[4]),5)
    if ab==cd:
        print("YES")
    else:
        print("NO")

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-11

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

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: def gaiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10:
        print("YES")
    else:
        print("NO")
a = int(input())

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

Python: # -*- coding:utf-8 -*-

def main():
    for i in range(int(input())):
        x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
        a=(y2-y1)/(x2-x1)
        b=(y4-y3)/(x4-x3)

        if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1))<1e-10:
            print("YES")
        else:
            print("NO")
    
        
if __name__ == '__main__':
    main()

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

Python: import math
N=range(int(raw_input()))
for i in N:
    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-10]

Python: import math

n = int(input())

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

    var = abs((x2-x1) * (y4-y3) - (x4-x3) * (y2-y1))

    if var < 1e-10:
        print("YES")
    else:
        print("NO")

Python: # coding=utf-8

n = int(input())
for i in range(n):
    points_list = list(map(float, input().split()))
    abx = points_list[2] - points_list[0]
    aby = points_list[3] - points_list[1]
    cdx = points_list[6] - points_list[4]
    cdy = points_list[7] - points_list[5]

    if abx == 0 or cdx == 0:
        if abx == 0 and cdx == 0:
            print('YES')
        else:
            print('NO')
    elif aby / abx == cdy / cdx:
        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(x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1) < 1e-10 else 'NO')

Python: from decimal import Decimal as Dec

for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(Dec, input().split()))
    if x1 - x2 == x3 - x4 and y1 - y2 == y3 - y4:
        print('YES')
    else:
        print('NO')

Python: for i in range(int(input())):
    l = list(map(float,input().split()))
    a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5]
    if a*d==c*b: print('YES')
    else: print('NO')

Python: cases = int(input())
i = 0
while i < cases:
   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=round(dy1*dx2,5)
   l=round(dy2*dx1,5)
   print(k)
   print(l)
   if(k==l):
       print("YES")
   else:
       print("NO")
   i += 1

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 or -1.0 - EPS <= f * g <= -1.0 + EPS:
        print('YES')
    else:
        print('NO')

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

Python: N = int(input())
for i in range(0, N) :
  x1,y1,x2,y2,x3,y3,x4,y4 = list(map(float, input().split()))
  s = x2 - x1
  t = y2 - y1
  u = x4 - x3
  v = y4 - y3;
  if (abs(s * v - t * u) < 1e-10) :
    print("YES")
  else :
    print("NO")

Python: E = 10 ** -20
def check(lst):
  x1, y1, x2, y2, x3, y3, x4, y4 = lst
  vabx, vaby = x2 - x1, y2 - y1
  vcdx, vcdy = x4 - x3, y4 - y3
  if abs(vabx * vcdy - vcdx * vaby) < E:
    return True
  else:
    return False

n = int(input())
for _ in range(n):
  plst = list(map(float, input().split()))
  print("YES" if check(plst) else "NO")

Python: import sys

args = sys.argv

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__)

# input = [6, 6, 6, 15, 15, 15,20,3]


# A,B,C,D = (Point(input[i],input[i+1]) for i in range(0,len(input),2))
# tmp = B - A
# tmp2 = C - D
# tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)

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: N = input()
 
for n in range(N):
    data = map(float,raw_input().split( ))
    slopes = []
    for i in range(2):
        _x1 = data.pop(0)
        _y1 = data.pop(0)
        _x2 = data.pop(0)
        _y2 = data.pop(0)
         
        if _x1 != _x2:
            slopes.append((_y1 - _y2)/(_x1 - _x2))
     
    if len(slopes) == 0:
        print("YES")
    elif len(slopes) == 1:
        print("NO")
    elif abs(slopes[0] - slopes[1]) < 1e-10:
        print("YES")
    else:
        print("NO")