Go: package main

import (
        "fmt"
        "math/big"
)

func main() {
        var x1, x2, x3, x4, y1, y2, y3, y4 big.Float
        var n int
        fmt.Scanf("%d", &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)
                var lx, ly, mx, my, mul1, mul2, sub, zz big.Float
                lx.Sub(&x2, &x1)
                ly.Sub(&y2, &y1)
                mx.Sub(&x4, &x3)
                my.Sub(&y4, &y3)
                mul1.Mul(&lx, &my)
                mul2.Mul(&ly, &mx)
                sub.Sub(&mul1, &mul2)
                zz.SetFloat64(0.0)

                if sub.Cmp(&zz) == 0 {
                        fmt.Println("YES")
                } else {
                        fmt.Println("NO")
                }
        }
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<math.h>
using namespace std;
#define SZ(n)  (int)n.size()
#define dump(x) cerr<<#x<<" = "<<(x)<<endl;
#define debug(x)cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define MP make_pair
#define PB push_back
	double EPS=1e-10;
	bool same(double a,double b){
		if(fabs(a-b)<=EPS)return 1;
		else return 0;
	}
	
	
	int main(){
	int n;
			double x1,y1,x2,y2,x3,y3,x4,y4,a1,a2;
	cin>>n;
	for(int i=0;i<n;i++){

		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		a1=(y1-y2)/(x1-x2);
		a2=(y3-y4)/(x3-x4);
		if(a1==a2)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	
	return 0;
}

C++: def naiseki(x1,y1,z1,x2,y2,z2)
    if x1-x2+y1-y2+z1-z2 == 0:
        print("YES")
    else:
        print("NO")
f = input().split()
try:
    x1=f[0]
    y1=f[1]
    z1=f[2]
    x2=f[3]
    y2=f[4]
    z2=[f5]
    naiseki(x1,y1,z1,x2,y2,z2)
except:
    print("NO")

C++: #include<iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;

    for(int i=0; i<n; i++){
        double x1, y1, x2, y2, x3, y3, x4, y4;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

        if( !((x1-x2)*(y3-y4)-(y1-y2)*(x3-x4)) ) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <complex>
using namespace std;

#define P complex<double>

// e·éë·Ã
#define EPS (1e-10)
// 2ÂÌXJ[ªµ¢©Ç¤©
#define EQ(a,b) (abs((a)-(b)) < EPS)

// e·éë·Ã
#define EPS (1e-10)
// 2ÂÌXJ[ªµ¢©Ç¤©
#define EQ(a,b) (abs((a)-(b)) < EPS)

// OÏ (cross product) : a~b = |a||b|sinÆ
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

// 2¼üÌ½s»è : a//b <=> cross(a, b) = 0
bool is_parallel(P a1, P a2, P b1, P b2) {
  return EQ( cross(a1-a2, b1-b2), 0.0 );
}


int main(){
  int n;
  P a,b,c,d;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> a.real() >> a.imag();
    cin >> b.real() >> b.imag();
    cin >> c.real() >> c.imag();
    cin >> d.real() >> d.imag();

    P x=a-b, y=c-d;
    x = x/abs(x);
    y = y/abs(y);

    if( is_parallel( a,b,c,d ) )
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void) {
  int n;
  float x1, y1, x2, y2, x3, y3, x4, y4;
  cin >> n;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
    if ((y1 - y2) / (x1 - x2) == (y3 - y4) / (x3 - x4)) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    cout << endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(){
  int n, i;
  double x[4], y[4];
  scanf("%d", &n);
  while(n--){
    scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]);
    if(((y[1] - y[0]) / (x[1] - x[0])) == ((y[3] - y[2]) / (x[3] - x[2]))) puts("YES");
    else puts("NO");
  }
  return 0;
}

C++: #include <array>
#include <complex>
#include <iostream>
using namespace std;

const double EPS = 1e-10;
template<class T>
bool eq(const T& a, const T& b) {return abs(a - b) < EPS;}

/* 点
 *
 * x 座標は p.real()
 * y 座標は p.imag()
 * 足し算，引き算，スカラー倍は定義済み
 */
using point = complex<double>;
namespace std {
	bool operator<(const point& a, const point& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}

/*
 * 直線・線分
 *
 * 辞書順の比較演算子が定義済み
 * 端点を for で走れる
 * {{x, y}} で初期化
 */
using line = array<point, 2>;

double cross(const point& a, const point& b) {
	return imag(conj(a)*b);
}


bool is_parallel(const line& s, const line& t) {
	return eq(cross(s[0] - s[1], t[0] - t[1]), 0.0);
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		line s, t;
		for (auto& p : s) {
			double x, y; cin >> x >> y;
			p = point(x, y);
		}
		for (auto& p : t) {
			double x, y; cin >> x >> y;
			p = point(x, y);
		}
		cout << (is_parallel(s, t)?"YES":"NO") << endl;
	}
	return 0;
}

C++: #include<iostream>
#define INF 10000000
using namespace std;
int main(){
  int n;
  double lI,lII,x1,y1,x2,y2,x3,y3,x4,y4;
  cin >> n;
  while(n--){
    cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    x1+=1000,y1+=1000,x2+=1000,y2+=1000,x3+=1000,y3+=1000,x4+=1000,y4+=1000;
    x2-=x1,y2-=y1,x4-=x3,y4-=y3;
    cout << ((x2==0&&x4==0)||(y2/x2 == y4/x4)?"YES":"NO") << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	double ax[4], ay[4], x[4], y[4];

	cin >> n;

	for(int i = 0; i < n; i++){
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];

		if(x[0] > x[1]){
			ax[0] = x[1];
			ay[0] = y[1];
			ax[1] = x[0];
			ay[1] = y[0];
		}
		else{
			ax[0] = x[0];
			ay[0] = y[0];
			ax[1] = x[1];
			ay[1] = y[1];
		}

		if(x[2] > x[3]){
			ax[2] = x[3];
			ay[2] = y[3];
			ax[3] = x[2];
			ay[3] = y[2];
		}
		else{
			ax[2] = x[2];
			ay[2] = y[2];
			ax[3] = x[3];
			ay[3] = y[3];
		}

		if((ax[1]-ax[0])==(ax[3]-ax[2]) && (ay[1]-ay[0])==(ay[3]-ay[2]))
			cout << "YES" << endl;
		else 
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main() {
	int n;
	double x1,x2,x3,x4,y1,y2,y3,y4,m,l;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		if((y2-y1)*(x4-x3)==(y4-y3)*(x2-x1))cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int z = 0; z < n; z++) {
		long float x1, x2, x3,y1, y2, y3, y4, x4 ;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if (y1 > y2) {
			swap(y1, y2);
			swap(x1, x2);
		}
		if (y3 > y4) {
			swap(y3, y4);
			swap(x3, x4);
		}
		if ((x1 > x2&&x3 > x4 && ((y2 - y1) / (x1 - x2) == (y4 - y3) / (x3 - x4))) || (x2 > x1&&x4 > x3 && ((y1 - y2) / (x2 - x1) == (y3 - y4) / (x4 - x3)))) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <iostream>
using namespace std ;

int main()
{
	int num ;
	float ax, ay, bx, by, cx, cy, dx, dy ;

	cin >> num ;
	for( int i = 0 ; i < num ; i ++ )
	{
		cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy ;

		if( (ay-by)/(ax-by) == (cy-dy)/(cx-dx) )
		{
			if( ax != cx && bx != dx )
			{
				cout << "YES\n" ;
			}
		}
		else cout << "NO\n" ;
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	double x[4]={0},y[4]={0};
	int i;
	scanf("%d",&i);

	while(i!=0)
	{
		scanf("%f %f %f %f %f %f %f %f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
		if(x[1]-x[0] == 0 && x[3]-x[2] == 0)
			printf("YES\n");
		else if(x[1]-x[0] == 0 || x[3]-x[2] == 0)
			printf("NO\n");
		else if(y[1]-y[0] == 0 && y[3]-y[2] == 0)
			printf("YES\n");
		else if(y[1]-y[0] == 0 || y[3]-y[2] == 0)
			printf("NO\n");
		else if((y[1]-y[0])/(x[1]-x[0]) == (y[3]-y[2])/(x[3]-x[2]))
			printf("YES\n");
		else 
			printf("NO\n");

		i-=1;
	}
 return 0;
}