Go: package main

import "fmt"

func abs(x float64) float64 {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n int
	var x1, y1, x2, y2, x3, y3, x4, y4 float64
	fmt.Scan(&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)
		if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: import math
import sys

input()
for i in sys.stdin.readlines():
    a = [float(x) for x in i.split()]
    ac = math.sqrt((a[0] - a[4]) ** 2 + (a[1] - a[5]) ** 2)
    bd = math.sqrt((a[2] - a[6]) ** 2 + (a[3] - a[7]) ** 2)
    if ac == bd:
        print('YES')
    else:
        print('NO')

Python: for i in range(int(input())):
    l = list(map(float,input().split()))
    a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5]
    if b==0 or d==0: continue
    if a/b==c/d: 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-9]

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

Python: 
n=int(input())

for i in range(n):
    xy=list(map(float,input().split(" ")))
    X1=xy[2]-xy[0]
    Y1=xy[3]-xy[1]
    X2=xy[6]-xy[4]
    Y2=xy[7]-xy[5]
    area=X1*X2-Y1*Y2
    if abs(area)<1e-12:
        print("YES")
    else:
        print("NO")

Python: def gaiseki(x1,y1,x2,y2,x3,y3,x4,y4):
    if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10:
        print("YES")
    else:
        print("NO")
a = int(input())

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

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 x2 == x4 == 0 else "NO")
    else:
        print("YES" if x2 / y2 == x4 / y4 else "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) - (g-e)*(d-b)) < 1e-10:
        print("YES")
    else:
        print("NO")

Python: r=[]
for i in range(int(input())):
    d=[float(i) for i in input().split()]
    if d[0]-d[2] != 0 and d[4]-d[6] != 0:
        a=(d[1]-d[3])/(d[0]-d[2])
        b=(d[5]-d[7])/(d[4]-d[6])
        if a==b:r.extend([1])
        else:r.extend([0])
    elif (d[0]==d[2] and d[4]==d[6]):
        r.extend([1])
    elif (d[1]==d[3] and d[5]==d[7]):
        r.extend([1])
    else:
        r.extend([0])
[print("YES") if i else print("NO") for i in r]

Python: #! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  # lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  # n = int(lines[0])
  n = int(raw_input())
  for i in xrange(n):
    # x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))

Python: import sys

n = int(input())
for s in sys.stdin:
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, s.strip().split())
    angle1 = (y2-y1)/(x2-x1)
    angle2 = (y4-y3)/(x4-x3)
    if angle1 == angle2:
        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 and angle1 + angle2 != 0:
        print("YES")
    else:
        print("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: 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]) if pos[2] - pos[0] != 0 else 0
    angle2 = abs(pos[7]-pos[5])/abs(pos[6]-pos[4]) if pos[6] - pos[4] != 0 else 0
    if angle1 == angle2:
        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 abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)) < 1e-5:
        print("YES")
    else:
        print("NO")

Python: for i in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    if (x1-x2)*(y3-y4)==abs((y1-y2)*(y3-y4)):
        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 = [float(x) for x in input().split()]

    a = [x2-x1, y2-y1]
    b = [x4-x3, y4-y3]

    if a[0]*b[1] == a[1]*b[0]:
        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())
    x12=x1-x2
    y12=y1-y2
    x34=x3-x4
    y34=y3-y4
    if (x12*x34+y12*y34)**2/(x12**2+y12**2)/(x34**2+y34**2)==1:
        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 (x2-x1)*(y4-y3) - (y2-y1)*(x4-x3) + 0 == 0.0:
        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 (s[0] - s[2]) / (s[1] - s[3]) == (s[4] - s[6]) / (s[5] - s[7]):
        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 or cdy == 0:
        if cdx == 0 and cdy == 0:
            print('YES')
        else:
            print('NO')        
    elif abx / cdx == aby / cdy:
        print('YES')
    else:
        print('NO')