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)
		}
		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: class line():
	def __init__(self):
		self.p={"x":0,"y":0}
		self.q={"x":0,"y":0}

	def setPoint(self,px,py,qx,qy):
		self.p["x"]=px
		self.p["y"]=py
		self.q["x"]=qx
		self.q["y"]=qy
	
	def getVector(self,rev=False):
		if(rev):
			return ((self.p["x"]-self.q["x"]),(self.p["y"]-self.q["y"]))
		else:
			return ((self.q["x"]-self.p["x"]),(self.q["y"]-self.p["y"]))

def main():
	l=line()
	m=line()
	
	for i in range(0,int(input())):
		(lambda x:(l.setPoint(*(x[0:4])),m.setPoint(*(x[4:8]))))(tuple(map(float,input().split(" "))))

		if((l.getVector()==(0,0))or(m.getVector()==(0,0))):
			print("NO")
		elif((lambda l,m:(l[0]/m[0])==(l[1]/m[1]))(l.getVector(),m.getVector())):
			print("YES")
		else:
			print("NO")

if __name__ == '__main__':
	main()

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

#x, y: direction vector
def is_parallel(x, y):
    if 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())
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]),8)==0:
        print("YES")
    else:
        print("NO")

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

input()

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 == 0.0:
    if x4 - x3 == 0.0:
      print("YES")
    else:
      print("NO")
  elif x4 - x3 == 0.0:
    print("NO")
  else:
    print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "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 x1==0:
        if x2==0:
            print("YES")
        else:
            print("NO")
    elif y1==0:
        if y2==0:
            print("YES")
        else:
            print("NO")
    else:
        if y1/x1==y2/x2:
            print("YES")
        else:
            print("NO")

Python: for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    if ((b-d)/(a-c)) == ((f-h)/(e-g)):
        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())
    if (x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1) == 0:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    Date = list(map(float,input().split()))
    if Date[2] != Date[0] or 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: 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())
    if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4):
        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
def cross(ab, cd):
    return ab.real * cd.imag - ab.imag * cd.real

n = int(f.readline())
for _ in range(n):
    a, b, c, d = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    print('YES' if abs(cross(a - b, c - d)) < 1e-10 else 'NO')

Python: 
import mth

num = int(input())

for i in range(num):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(' '))
    aaa = (y1 - y2) * (x3 - x4)
    bbb = (y3 - y4) * (x1 - x2)
    if abs(aaa - bbb) <= 0:
        print('YES')
    else:
        print('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 = list(map(float, raw_input().split()))
    if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 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())
    print('YES' if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4) else '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 = [int(100000*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:
        print("YES")
    else:
        print("NO")

Python: for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = [float(x) for x in input().split()]
    s1 = round((y2 - y1) / (x2 - x1), 10) if x1 != x2 else float('inf')
    s2 = round((y4 - y3) / (x4 - x3), 10) if x3 != x4 else float('inf')
    
    print("YES" if s1 == s2 else "NO")

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

Python: n = int(input())
for _ in range(n):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    a1 = (ay-by)/(ax-bx)
    a2 = (cy-dy)/(cy-dy)
    if a1 == a2:
        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 abx / cdx == aby / cdy:
        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 cross == 0:
        print('YES')
    else:
        print('NO')