Go: package main

import (
        "fmt"
        "math/big"
)

func main() {
        var x1, x2, x3, x4, y1, y2, y3, y4 big.Float
        var n int
        fmt.Scanf("%d", &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)
                var lx, ly, mx, my, mul1, mul2, sub, zz big.Float
                lx.Sub(&x2, &x1)
                ly.Sub(&y2, &y1)
                mx.Sub(&x4, &x3)
                my.Sub(&y4, &y3)
                mul1.Mul(&lx, &my)
                mul2.Mul(&ly, &mx)
                sub.Sub(&mul1, &mul2)
                zz.SetFloat64(0.0)

                if sub.Cmp(&zz) == 0 {
                        fmt.Println("YES")
                } else {
                        fmt.Println("NO")
                }
        }
}

Python: for i in range(int(input())):
  a,b,c,d,e,f,g,h = map(float,input().split())
  if a == c:
    print("YES" if e == g else "NO")
  elif e == g:
    print("NO")
  else:
    print("YES" if (b-d)/(a-c) == (f-h)/(e-g) 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__)

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:
      yield "YES"
    else:
      yield "NO"

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

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-


import collections
import math


LIMIT = 0.0000001


class Vector2(collections.namedtuple("Vector2", "x y")):

    __slots__ = ()

    def __add__(self, other):
        return Vector2(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Vector2(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return self.x * other.y - self.y * other.x

    def __neg__(self):
        return Vector2(-self.x, -self.y)

    def __pos__(self):
        return Vector2(+self.x, +self.y)

    def __abs__(self):
        return math.sqrt(float(self.x * self.x + self.y * self.y))

    def dotproduct(self, other):
        return self.x * other.x + self.y * other.y


def main():
    n = int(input())
    for i in range(n):
        [x1, y1, x2, y2, x3, y3, x4, y4] = [float(z) for z in input().split()]
        vector_ab = Vector2(x2 - x1, y2 - y1)
        vector_cd = Vector2(x4 - x3, y4 - y3)
        if abs(vector_ab * vector_cd) < LIMIT:
            print("YES")
        else:
            print("NO")


if __name__ == "__main__":
    main()

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,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=dy1*dx2
   l=dy2*dx1
   if( k==l ):
       print("YES")
   else:
       print("NO")
   i += 1

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

Python: while True:
    try:
        a=[float(i) for i in input().split()]
    except:
        break
    dx1=a[2]-a[0]
    dy1=a[3]-a[1]
    dx2=a[6]-a[4]
    dy2=a[7]-a[5]
    if dx1==0 and dx2==0 or dy1/dx1==dy2/dx2:
        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-8]

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

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

        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]):
        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 abs(angle1 - angle2) <= 1e-10:
        print("YES")
    else:
        print("NO")

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

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print(["NO","YES"][abs((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2)) < 10e-4])

Python: import sys

lines = sys.stdin.readlines()
size = int(lines[0])
data = lines[1:len(lines)]
for line in data:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(float(i))
    x = []
    x.append(inp[0])
    x.append(inp[2])
    x.append(inp[4])
    x.append(inp[6])
    y = []
    y.append(inp[1])
    y.append(inp[3])
    y.append(inp[5])
    y.append(inp[7])
    tilt1 = (y[1]-y[0])/(x[1]-x[0])
    tilt2 = (y[3]-y[2])/(x[3]-x[2])
    if tilt1==tilt2:
        print ("YES")
    else:
        print ("NO")

Python: for i in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4=map(lambda x: int(100000*float(x)),input().split())
    if (x1-x2)*(y3-y4)==abs((y1-y2)*(y3-y4)):
        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,input().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: ABs=[]
CDs=[]
n = int(input())
for i in range(n):
    x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split())
    AB = [x_2 - x_1, y_2 - y_1]
    CD = [x_4 - x_3, y_4 - y_3]
    ABs.append(AB)
    CDs.append(CD)
for i in range(n):
    if ABs[i][0]*CDs[i][1]==ABs[i][1]*CDs[i][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())
    print('YES' if abs((x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1)) < 1e-10 else 'NO')