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: import sys

# args = sys.argv

args = [int(float(a)) 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: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if x1 == x2 and x3 == x4:
        print("YES")
    elif x1 == x2 or x3 == x4:
        print("NO")
    elif abs((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) < 1e-10:
        print("YES")
    else:
        print("NO")

Python: n=int(input())
for i in range(n):
    a=[float(i) for i in input().split()]
    dx1=a[2]-a[0]
    dy1=a[3]-a[1]
    dx2=a[6]-a[4]
    dy2=a[7]-a[5]
    if dx1==0 or dx2==0:
        if dx1==0 and dx2==0:
            print("YES")
        else:
            print("NO")
    elif (dy1/dx1-dy2/dx2)<1e-10:
        print("YES")
    else:
        print("NO")

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

Python: import math
import cmath
def dot(a:complex,b:complex):
  return (a.conjugate()*b).real
def cross(a:complex,b:complex):
  return (a.conjugate()*b).imag
eps=10**(-11)
n=int(input())
for i in range(n):
  l=list(map(float,input().split()))
  p=[complex(l[2*j],l[2*j+1]) for j in range(4)]
  print('YES' if abs(cross(p[1]-p[0],p[3]-p[2]))<eps else 'NO')

Python: import math
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
            if math.fabs((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) <= 0.00001:
                print("YES")
            else:
                print("NO")

Python: n = int(input())
ans = []
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay - by) / (ax - bx)
    a2 = (cy - dy) / (cx - dx)
    if a1 == a2:
        ans.append("YES")
    else:
        ans.append("NO")
print(*ans, sep="\n")

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

Python: N = int(input())
for i in range(N):
    x1,y1,x2,y2,x3,y3,x4,y4 = [float(i) for i in input().split()]
    xn = x1-x2
    yn = y1-y2
    xm = x3-x4
    ym = y3-y4

    if xn*ym == xm*yn:
        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())
       dy1 = y2 - y1
       dy2 = y4 - y3
       dx1 = x2 - x1
       dx2 = x4 - x3
       if(dy1*dx2 == dy2*dx1):
           print("YES")
       else:
           print("NO")
   i += 1

Python: # ????????????????????°??????
import sys

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    d1x = x2 - x1
    d1y = y2 - y1
    d2x = x4 - x3
    d2y = y4 - y3

    if d1x != 0.0 and d2x != 0.0:
        a1 = d1y / d1x
        a2 = d2y / d2x
        return a1 == a2

    if d1x == 0.0 and d2x == 0.0:
        return True

    return False

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

Python: for i in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4=map(lambda x: int(100000*float(x)),input().split())
    x12=x1-x2
    y12=y1-y2
    x34=x3-x4
    y34=y3-y4
    if (x12*x34+y12*y34)**2==(x12**2+y12**2)*(x34**2+y34**2):
        print("YES")
    else:
        print("NO")

Python: def main():
    n = int(input())
    for i in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        if (y2-y1)/(x2-x1) == (y4 - y3)/(x4 -x3):
            print("YES")
        else:
            print("NO")

if __name__ == '__main__':
    main()

Python: import sys

if __name__=='__main__':
  lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  n = int(lines[0])
  for i in xrange(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))

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

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

Python: n = int(input())
ans = []
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay - by) / (ax - bx) if (ax - bx) != 0 else float("inf")
    a2 = (cy - dy) / (cx - dx) if (cx - dx) != 0 else float("inf")
    if a1 == a2:
        ans.append("YES")
    else:
        ans.append("NO")
print(*ans, sep="\n")

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