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: from fractions import Fraction

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 ** 5),(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: 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 abs((y2-y1)/(x2-x1)-(y4-y3)/(x4-x3))<10**-10:
            print("YES")
        else:
            print("NO")

Python: for _ in range(int(input())):
    ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split())
    print(['NO','YES'][(ay-by)*(dx-cx)-(ax-bx)*(dy-cy)<1e-10])

Python: n = int(input())
for i in range(n):
  try:
    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")
    print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
  except:
    break

Python: import sys
n = input()
for line in sys.stdin.readlines():
  l = [float(i) for i in line.split()]
  if (l[2]-l[0])*(l[7]-l[5]) == (l[3]-l[1])*(l[6]-l[4]):
    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())
    x2 -= x1; y2 -= y1
    x4 -= x3; y4 -= y3
    print("YES" if abs(x2*y4 - x4*y2) < 1e-10 else "NO")

Python: import sys
import math

n = int(input())
for s in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().strip().split())
    angle1 = abs(y2-y1)/abs(x2-x1)
    angle2 = abs(y4-y3)/abs(x4-x3)
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

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

if __name__ == '__main__':
    main()

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

Python: # ????????????????????°??????
import sys

def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
    d1x = x2 - x1
    d1y = y2 - y1
    d2x = x4 - x3
    d2y = y4 - y3

    if d1x != 0 and d2x != 0:
        a1 = d1y / d1x
        a2 = d2y / d2y
        return a1 == a2

    if d1x == 0 and d2x == 0:
        return True

    return False

def main():
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        data = sys.stdin.readline().strip().split(' ')
        x1 = float(data[0])
        y1 = float(data[1])
        x2 = float(data[2])
        y2 = float(data[3])
        x3 = float(data[4])
        y3 = float(data[5])
        x4 = float(data[6])
        y4 = float(data[7])

        if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
            print('YES')
        else:
            print('NO')
            
if __name__ == '__main__':
    main()

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: 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: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    print(info)

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 abs(ab[0] * cd[1] - ab[1] * cd[0]) > 0.000001:
        print('NO')
    else:
        print('YES')

Python: from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from sys import stdin

def gradient(x1, y1, x2, y2):
    return (y1 - y2) / (x1 - x2)

for n in xrange(int(stdin.readline())):
    p = [float(s) for s in stdin.readline().split()]
    if gradient(*p[:4]) == gradient(*p[4:]):
        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())
  v1x = x1 - x2
  v1y = y1 - y2
  v2x = x3 - x4
  v2y = y3 - y4
  if abs(v1x * v2y - v2x * v1y) < 10 ** -10 :
    print("YES")
  else:
    print("NO")

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

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

Python: import sys

args = sys.argv

print(args)


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 tmp3 == 0:
      print("YES")
    else:
      print("NO")

Python: def calc(a):
    i1 = (a[3] - a[1]) / (a[2] - a[0])
    i2 = (a[7] - a[5]) / (a[6] - a[4])
    if i1 == i2:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    N = int(input())
    a = []
    for i in range(0, N):
        a.append(list(map(float, input().split())))
        calc(a[i])