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: # 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 cdx == 0 or cdy == 0:
        if cdx == 0 and cdy == 0:
            print('YES')
        else:
            print('NO')        
    elif abx / cdx == aby / cdy:
        print('YES')
    else:
        print('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 not _ == 0:
    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: import math
import cmath
def cross_product(a,b):
    return (a.conjugate()*b).imag
n = int(input())
for i in range(n):
    L = list(map(float,input().split()))
    a,b,c,d = [complex(L[j*2],L[j*2+1]) for j in range(4)]
    vec_A = b-a
    vec_B = d-c
    if abs(cross_product(vec_A,vec_B)) < 1e-11:
        print('YES')
    else:
        print('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 (s * v - t * u < 1.000000001) :
    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 cdx == 0:
        if cdy == 0:
            print('YES')
        else:
            print('NO')
    elif abx / cdx == aby / cdy:
        print('YES')
    else:
        print('NO')

Python: for a,b,c,d,e,f,g,h in[map(float,raw_input().split())for i in range(input())]:print["NO","YES"][abs((a-c)*(f-h)-(b-d)*(e-g))<1e-10]

Python: n = int(input())
s1 = 0
s2 = 0
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float,input().split())
    if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1)) <= 10**(-10): print("YES")
    else: print("NO")

Python: import math


def equal(x, y):
    return math.fabs(x - y) <= 10 ** (-8)


def spam(_x1, _y1, _x2, _y2):
    if _x1 > _x2:
        return _x1, _y1, _x2, _y2
    else:
        return _x2, _y2, _x1, _y1


for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    x1,y1,x2,y2 = spam(x1,y1,x2,y2)
    d1 = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
    aco = (x1 - x2) / d1
    asi = (y1 - y2) / d1

    x3,y3,x4,y4 = spam(x3,y3,x4,y4)
    d2 = math.sqrt((x3 - x4) ** 2 + (y3 - y4) ** 2)
    bco = (x3 - x4) / d2
    bsi = (y3 - y4) / d2

    if equal(aco,bco) and  equal(bco,bsi):
        print('YES')
    else:
        print('NO')

Python: import sys
import math

n = int(input())
for s in range(n):
    pos = list(map(float, input().split()))
    angle1 = abs(pos[3]-pos[1])/abs(pos[2]-pos[0])
    angle2 = abs(pos[7]-pos[5])/abs(pos[6]-pos[4])
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

Python: N = int(input())
for _ in range(N):
    P = list(map(float,input().split()))
    a, b, c, d = [complex(P[i*2],P[i*2+1])*1000000 for i in range(4)] 
    parallel = ((a-b).conjugate() *(c-d)).imag ==0
    print("YES" if parallel 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 abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1))
          < 1e-10 else 'NO')

Python: n = int(input())
for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()]
  if x2 == x1:
    if x4 == x3:
      print("YES")
    else:
      print("NO")
  elif x4 == x3:
    print("NO")
  else:
    print("YES" if (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-10 else "NO")

Python: for _ in range(int(input())) :
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(__) for __ in input().split()]
    a, b = ((y2 - y1) / (x2 - x1)), ((y4 - y3) / (x4 - x3))
    if a == b : 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"][(w-x)*(c-d)==(y-z)*(a-b)]

Python: # coding=utf-8

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 == cdx and aby == cdy:
    print('YES')
else:
    print('NO')

Python: # coding: utf-8

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

	try:
		if (x1 == x2) and (x3 == x4):
			print("YES")
		elif (y2-y1)/(x2-x1)*1.0 == (y4-y3)/(x4-x3)*1.0:
			print("YES")
		else:
			print("NO")
	except ZeroDivisionError:
		print("NO")

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    ab = [x2 - x1, y2 - y1]
    cd = [x4 - x3, y4 - y3]
    if ab[0] * cd[1] - ab[1] * cd[0]:
        print('NO')
    else:
        print('YES')

Python: n = int(input())
for i in range(n):
    Date = list(map(float,input().split()))
    if Date[2] != Date[0] and Date[6] != Date[4]:
        if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]):
            print("YES")
            continue
        else:
            print("NO")
            continue
    elif Date[2] != Date[0] and Date[6] != Date[4]:
        print("YES")

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

    if x1 == x2:
        ans = x3 == x4
    elif x3 == x4:
        ans = False
    else:
        ans = ((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) < 1e-5

    print("YES") if ans else print("NO")

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

Python: # Aizu Problem 0021: Parallelism
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


N = int(input())
for n in range(N):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(_) for _ in input().split()]
    det = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3)
    print("YES" if abs(det) < 1e-6  else "NO")