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 <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

typedef pair<double, double> XY;

bool para(XY p, XY q) {
    double k;
    if (p.first == 0 && q.first == 0) return false;
    else k = q.first / p.first;
    if ((abs(p.second * k - q.second) * 1000000000000) < 1) return true;
    return false;
}

int main() {
    int n;
    cin >> n;
    REP(i,n) {
        double ax, ay, bx, by, cx, cy, dx, dy;
        cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy;
        XY AB = make_pair(ax-bx, ay-by);
        XY CD = make_pair(cx-dx, cy-dy);
        if (para(AB, CD)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define rep(i,x) for(int i = 0; i < (x); ++(i))
int main() {
	int n;
	cin >> n;
	while(n--) {
		double x[4], y[4];
		double EPS = 1e-10;
		rep(i,4) {
			cin >> x[i] >> y[i];
		}
		if(abs((x[1] - x[0]) * (y[3] - y[2]) - (x[3] - x[2]) * (y[1] - y[0])) > EPS) {
			cout << "NO" << endl;
		} else cout << "YES" << endl;
	}
	return 0;
}

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

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < 8; j++) {
			string str;
			cin >> str;
			int k = str.find('.');
			if(str.size()-1 - k > 5)
				abort();
		}
		cout << "YES" << endl;
	}
}

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

int main()
{
	double a, b, c, d, e, f, g, h;
	int x;
	cin >> x;
	for(int p=0;p<x;p++)
	{
		cin >> a >> b >> c >> d >> e >> f >> g >> h;
		double i = (d - b) / (c - a);
		double j = (h - f) / (g - e);
		if (i == j) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int main()
{
	double a, b, c, d, e, f, g, h;
	int x;
	cin >> x;
	for(int p=0;p<x;p++)
	{
		cin >> a >> b >> c >> d >> e >> f >> g >> h;
		double i = (d - b) / (c - a);
		double j = (h - f) / (g - e);
		if (i == j) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++:                                       
#include <iostream>
#include <cmath>
using namespace std;
int main(){


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

  }

  return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;
 
double cross_product(xy_t a, xy_t b) {
  return (conj(a) * b).imag();
}
 
const double eps = 1e-11;
double x[4], y[4];
int N;
int main() {
  cin >> N;
  for (int t = 0; t < N; ++t) {
    for (int i = 0; i < 4; ++i) {
      cin >> x[i] >> y[i];
    }
    xy_t a[2] = {
      xy_t(x[0], y[0]) - xy_t(x[1], y[1]),
      xy_t(x[2], y[2]) - xy_t(x[3], y[3])
    };
    bool p = abs(cross_product(a[0], a[1])) < eps;
    cout << (p ? "YES" : "NO") << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;
double x[100], y[100];

int main(){
	cin >> n;
	REP(i, n){
		REP(i, 4){
			cin >> x[i] >> y[i];
		}
		if ((y[0] - y[1]) / (x[0] - x[1]) == (y[2] - y[3]) / (x[2] - x[3])){
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
	}
}

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

int main(){
	int n;cin >> n;
	double a[8];
	while(n--){
		for(int i = 0;i < 8;i++)cin >> a[i];
		double y1 = a[3]-a[1];double x1 = a[2]-a[0];
		double y2 = a[7]-a[5];double x2 = a[6]-a[4];
		double ans = y1*x2-y2*x1;
		if(ans == 0)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0; 
}

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

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