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[4] == fpoints[6] {
			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: 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: 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 and angle1 != 0:
        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-5])

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(ABs[i][0]*CDs[i][1]-ABs[i][1]*CDs[i][0])<10**(-10):
        print("YES")
    else:
        print("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)<=1e-10:
        print("YES")
    else:
        print("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] or t[0]):
        print("YES")
        continue
    if s[1]/s[0] == t[1]/t[0]:
        print("YES")
    else:
        print("NO")

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

import sys
import os

N = int(input())

for i in range(N):
    ax, ay, bx, by, cx, cy, dx, dy = list(map(float, input().split()))
    AB = (bx - ax, by - ay)
    CD = (dx - cx, dy - cy)
    cross = AB[0] * CD[1] - AB[1] * CD[0]
    if abs(cross) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    abx = x2 - x1
    aby = y2 - y1
    cdx = x4 - x3
    cdy = y4 - y3
    if abs(aby * cdx) < 1e-10 and abs(cdy * abx) < 1e-10:
        print(['NO', 'YES'][abs(abx - cdx) < 1e-10 or abs(aby - cdy) < 1e-10])
    elif abs(aby * cdx - cdy * abx) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = int(input())
for l in range(N):

    P = [float(i) for i in input().split()]
    x1,y1,x2,y2,x3,y3,x4,y4 = P
    xa = x2-x1
    ya = y2-y1
    xb = x4-x3
    yb = y4-y3
    if xa*yb-ya*xb < 0.0000000001:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
	line = list(map(float,input().split()))
	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")

Python: import sys
f = sys.stdin


def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
    

n = int(f.readline())
for _ in range(n):
    xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    a, b, c, d = xy
    temp = (a - b) / (c - d)
    if  abs(temp.imag) < 0.001:
        if a - c == 0:
            print('NO')
        else:
            temp = (a - b) / (a - c)
            if abs(temp.imag) < 0.001:
                print('NO')
            else:
                print('YES')
    else:
        print('NO')

Python: import sys
f = sys.stdin

def take2(iterable):
    i = iter(iterable)
    while True:
        yield next(i) + next(i) * 1j
    

n = int(f.readline())
for _ in range(n):
    xy = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    a, b, c, d = xy
    if a.real > b.real:
        a, b = b, a
    if c.real > d.real:
        c, d = d, c
    temp = (a - b) / abs(a - b) - (c - d) / abs(c - d) 
    if  abs(temp.real) < 0.01 and abs(temp.imag)  < 0.01:
        print('YES')
    else:
        print('NO')

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 and x3 == x4) or (y1 == y2 and y3 == y4):
		print('YES')
	elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4):
		print('YES')
	else:
		print('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())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''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: import math
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''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 abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.00001:
            print("YES")
        else:
            print("NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    det = (y1-y2) * (x3-x4) - (x1-x2) * (y3-y4)
    if det<1e-12 :
        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(raw_input())
f=[]
for i in range(a):
    f.append(map(float,raw_input().split()))
for g in f:
    try:
        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: import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = int(input())
for l in range(N):

    P = [float(i) for i in input().split()]
    for i in range(len(P)):
        P[i] = int(P[i]*100000)

    x1,y1,x2,y2,x3,y3,x4,y4 = P
    xa = x2-x1
    ya = y2-y1
    xb = x4-x3
    yb = y4-y3
    if xa*yb-ya*xb == 0:
        print("YES")
    else:
        print("NO")