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[1] == fpoints[3] {
			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: 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 abs(x1*y2-x2*y1)<=0.00001:
        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 abs((x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)) < 1e-10: print("YES")
    else: print("NO")

Python: import math

epsilon = 1e-10

def get_grad(v1, v2):
    return v1[0] * v2[1] - v1[1] * v2[0]

def run():
    N = int(input())
    for _ in range(N):
        x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
        _v1 = (x2 - x1, y2 - y1)
        _v2 = (x4 - x3, y4 - y3)
        grad = get_grad(_v1, _v2)
        if abs(grad) < epsilon:
            print('YES')
        else:
            print('NO')

if __name__ == '__main__':
    run()

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

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-5])

Python: import sys
import math

n = int(input())
for s in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().strip().split())
    angle1 = fabs(y2-y1)/fabs(x2-x1)
    angle2 = fabs(y4-y3)/fabs(x4-x3)
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

Python: def cross(x, y):
    return (x.conjugate() * y).imag

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-10:
        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())
for j in range(n):
    p=[float(i) for i in input().split()]
    if p[2]-p[0]==0 or p[6]-p[4]==0:
        print(["YES","NO"][bool(p[2]-p[0]+p[6]-p[4])])
    else:
        print(["YES","NO"][bool(((p[3]-p[1])/(p[2]-p[0]))-((p[7]-p[5])/(p[6]-p[4])))])

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    det = abs((y1-y2) * (x3-x4) - (x1-x2) * (y3-y4))
    if det<1e-12 :
        print("YES")
    else:
        print("NO")

Python: def cross(x, y):
    return (x.conjugate() * y).imag

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-10:
        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: num = int(input())

EPS = 0.00000000001

for _ in range(num):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(x) for x in input().split()]
    
    abx = x2 - x1
    aby = y2 - y1
    cdx = x4 - x3
    cdy = y4 - y3
    # abx : aby = cdx : cdy
    # aby * cdx - abx * cdy = 0 ( < EPSilon)
    
    if abs(aby * cdx - abx * cdy) < EPS:
        print("YES")
    else:
        print("NO")

Python: import math
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0:
        print("YES")
    else:
        print("NO")
a = int(input())

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

Python: for _ in range(int(input())):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    print(['NO','YES'][(by-ay)/(bx-ax)==(dy-cy)/(dx-cx)])

Python: import math
for i in range(int(raw_input())):
    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: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    try:
        i = (b-d)/(a-c)
    except:
        i = 90

    try:
        j = (f-h)/(e-g)
    except:
        j = 90
    
    if i == j:
        print("Yes")
    else:
        print("No")

input()

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 y2 == 0 or y4 == 0:
        print("YES" if y2 == y4 == 0 else "NO")
    else:
        print("YES" if x2 / y2 == x4 / y4 else "NO")

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))==0:
            print("YES")
        else:
            print("NO")
    
        
if __name__ == '__main__':
    main()

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

Python: def cross(x, y):
    return (x.conjugate() * y).imag

#x, y: direction vector
def is_parallel(x, y):
    if cross(x, y) == 0:
        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: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    if info[2]==info[0]:
        if info[6]==info[4]:
            print("YES")
        else:
            print("NO")
    elif info[6]==info[4]:
        if info[2]==info[0]:
            print("YES")
        else:
            print("NO")
    else:
        if (info[3]-info[1])/(info[2]-info[0])==(info[7]-info[5])/(info[6]-info[4]):
            print("YES")
        else:
            print("NO")

Python: E = 10 ** -10
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: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    s = [x2-x1, y2-y1]
    t = [x4-x3, y4-y3]
    if not (s[0] and t[0]):
        if not (s[0] or t[0]):
            print("YES")
        else:
            print("NO")
        continue
    if s[1]/s[0] == t[1]/t[0]:
        print("YES")
    else:
        print("NO")