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 <cstdio>
#include <cmath>
using namespace std;
int main(){
	int n;
	double x1,y1,x2,y2,x3,y3,x4,y4;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		double a,b,c,d;
		a=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
		b=sqrt(pow(x3-x1,2)+pow(y3-y1,2));
		c=sqrt(pow(x4-x3,2)+pow(y4-y3,2));
		d=sqrt(pow(x4-x2,2)+pow(y4-y2,2));
		if(a==c&&b==d){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
    int N;
	cin>>N;
	while(N--){
		bool ans;
		double x1,y1,x2,y2,x3,y3,x4,y4;
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		double a,b;
		if(x1==x2){
			x3==x4?ans=true:ans=false;
		}else if(x3==x4){
			ans=false;
		}else{
			a=(double)(y1-y2)/(x1-x2);
			b=(double)(y3-y4)/(x3-x4);
			a==b?ans=true:ans=false;
		}
		ans?puts("YES"):puts("NO");
	}
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
using namespace std;
int main() {
	int n;
	double x1, y1, x2, y2, x3, y3, x4, y4;
	cin >> n;
	for (int z = 0; z < n; z++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

C++: //Parallelism
#include<bits/stdc++.h>
using namespace std;

const double EPS = 1E-15;

inline bool cmp(double x, double y){
  return abs(x-y) < EPS;
}

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

C++: #include <iostream>
#include <map>

using namespace std;

int main(void){
	int n;
	float x[2],y[2];
	pair<float,float> v[2];

	cin >> n;
	for(int i=0;i<n;i++){
		for(int j=0;j<2;j++){
			cin >> x[0] >> y[0] >> x[1] >> y[1];
			v[j]=make_pair(x[0]-x[1],y[0]-y[1]);
		}
		cout << (v[0].first*v[1].second-v[0].second*v[1].first?"NO":"YES") << endl;
	}
		
	return 0;
}

C++: #include <iostream>
using namespace std;
int n;
double xa,xb,xc,xd,ya,yb,yc,yd,ta,tb,tc,td;
int main(){
	int i;
	while(cin >> n){
		for(i=0;i<n;i++){
			cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
			ta = xb - xa;
			tb = yb - ya;
			tc = xd - xc;
			td = yd - yc;
			if(tb == td && ta == tc) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>

int main()
{
	int n;
	double x[4], y[4];
	std::cin >> n;
	while( n-- ){
		for( int i = 0; i < 4; i++ ){
	 		std::cin >> x[i] >> y[i];
		}
		
		if( ( x[1] - x[0] ) * ( y[3] - y[2] ) == ( x[3] - x[2] ) * ( y[1] - y[0] ) ) puts("YES");
		else if( x[0] == x[1] && x[2] == x[3] ) puts("YES");
		else if( y[0] == y[1] && y[2] == y[3] ) puts("YES");
		else puts("NO");
	}

 	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
#include <vector>
#include <cstdio>
using namespace std;
typedef long long ll;
typedef complex<long long> xy_t;

double crossPro(xy_t a, xy_t b)
{
	return (conj(a) * b).imag();
}

int main()
{
	int N;
	double x[4],y[4];
	ll 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];
		for (int j = 0; j < 4; ++j)
		{
			X[j] = round(x[j] * 1e5);
			Y[j] = round(y[j] * 1e5);
			//cout << X[j] << " " << Y[j] << endl;
		}
		xy_t t1(X[0],Y[0]);
		xy_t t2(X[1],Y[1]);
		xy_t t3(X[2],Y[2]);
		xy_t t4(X[3],Y[3]);

		if (crossPro(t2-t1,t4-t3) == 0)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int main() {
	double x[4], y[4], m[2];
	int i, n;
	cin >> n;
	while (n--) {
		for (i = 0; i < 4; i++)
			cin >> x[i] >> y[i];
		if (x[0] == x[1] && x[2] == x[3])
			cout << "YES" << endl;
		else if (x[0] == x[1] || x[2] == x[3])
			cout << "NO" << endl;
		else {
			m[0] = (y[0]-y[1]) / (x[0]-x[1]);
			m[1] = (y[2]-y[3]) / (x[2]-x[3]);
			if (m[0] == m[1])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
	}
	return 0;
}