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")
		} else {
			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: def main():
    n = int(input())

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

if __name__ == '__main__':
    main()

Python: from fractions import Fraction
'''
def judgeX0(Ax,Ay,Bx,By,Cx,Cy,Dx,Dy):
	ABx = Bx - Ax
	CDx = Dx - Cx
	if ABx == 0:
		if CDx == 0:
			if Cx == Bx:
				return 0
			else:
				return 2
		else:
			return 0
	elif CDx == 0:
		return 0
	else:
		return 1
'''
def sroap(x1,y1,x2,y2):
	if x2 - x1 == 0:
		return float("inf")
	else:
		return Fraction(y2 - y1,x2 - x1)
		
N = int(input())
for n in range(N):
	Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 6),(map(float,input().split())))
	if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy):
		if sroap(Ax,Ay,Bx,By) == sroap(Bx,By,Cx,Cy):
			print("NO")
		else:
			print("YES")
	else:
		print("NO")

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

Python: n=int(input())

ESP=1e-10

for t in range(n):
  s=input()
  item=s.split()
  x=[]
  y=[]
  for i in range(4):
    x.append(float(item[i*2]))
    y.append(float(item[i*2+1]))
  if abs(x[0]-x[1])<=ESP or abs(x[2]-x[3])<=ESP:
    if abs(x[0]-x[1])<=ESP and abs(x[2]-x[3])<=ESP:
      print("YES")
    else:
      print("NO")
  else:
    if abs((y[0]-y[1])/(x[0]-x[1])-(y[2]-y[3])/(x[2]-x[3]))<=ESP:
      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 x1 == x2 and y1 == y2 or x3 == x4 and y3 == y4:
        print('YES')
    else:
        print('YES' if abs(x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1) < 1e-10 else '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 aby == 0 or cdy == 0:
        if aby == 0 and cdy == 0:
            print('YES')
        else:
            print('NO')
    elif abx / aby == cdx / cdy:
        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(round((p[3]-p[1])/(p[2]-p[0]),5)-round((p[7]-p[5])/(p[6]-p[4]),5))])

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

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: N = int(input())
for _ in range(0, N) :
  x1,y1,x2,y2,x3,y3,x4,y4 = list(map(float, input().split()))
  if ((y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3)) :
    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] and Date[6] != Date[4]:
        if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]):
            print("YES")
        else:
            print("NO")
    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 abs((y1-y2)*(x4-x3) - (y4-y3)*(x1-x2)) < 1e-10:
        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: 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:
        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):
    a, b, c, d = [xiyi for xiyi in take2(map(float, f.readline().split()))]
    ab, cd = a - b, c - d
    if abs((ab * cd).real) < 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 (y2-y1)/(x2-x1)==(y4-y3)/(x4-x3):
        print("YES")
    else:
        print("NO")

Python: import sys
cases = int(input())
i = 0
while i <= cases:
   #for line in sys.stdin.readlines():
   x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=round(dy1*dx2,5)
   l=round(dy2*dx1,5)
   if(k==l):
       print("YES")
   else:
       print("NO")
   i += 1

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

Python: n = int(input())
for i in range(n):
  x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) * 10**10 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) else "NO")

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-


import collections
import math


LIMIT = 1e-10


class Vector2(collections.namedtuple("Vector2", "x y")):

    __slots__ = ()

    def __add__(self, other):
        return Vector2(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Vector2(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return self.x * other.y - self.y * other.x

    def __neg__(self):
        return Vector2(-self.x, -self.y)

    def __pos__(self):
        return Vector2(+self.x, +self.y)

    def __abs__(self):
        return math.sqrt(float(self.x * self.x + self.y * self.y))

    def dotproduct(self, other):
        return self.x * other.x + self.y * other.y


def main():
    n = int(input())
    for i in range(n):
        [x1, y1, x2, y2, x3, y3, x4, y4] = [float(z) for z in input().split()]
        vector_ab = Vector2(x2 - x1, y2 - y1)
        vector_cd = Vector2(x4 - x3, y4 - y3)
        if abs(vector_ab * vector_cd) < LIMIT:
            print("YES")
        else:
            print("NO")


if __name__ == "__main__":
    main()