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>
using namespace std;
typedef struct vec vec;

struct vec {
	double x, y;
};

static vec P(double x, double y){
	vec P = {x, y};
	return P;
}

static vec sub(vec a, vec b){
	return P(a.x - b.x, a.y - b.y);
}

static double cross(vec a, vec b){
	return (a.x * b.y - a.y * b.x);
}

int main(void){
    
int n;
cin >> n;
double x1, y1, x2, y2, x3, y3, x4, y4;
for(int i = 0; i < n; i++){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
	vec v1 = P(x1, y1);
	vec v2 = P(x2, y2);
	vec v3 = P(x3, y3);
	vec v4 = P(x4, y4);
	vec a = sub(v1, v2);
	vec b = sub(v3, v4);
	if (cross(a, b) == 0)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
return 0;

}

C++: #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double pi = acos(-1);
const double EPS = 1e-8;

double cross(pair<double,double> c,pair<double,double> d){
  return c.first * d.second - d.first * c.first;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<pair<double,double>> a(4);
  int n;
  pair<double,double> lineab, linecd;
  cin >> n;
  REP(i,n){
    REP(j,4){
      cin >> a[j].first >> a[j].second;
    }
    lineab.first = a[1].first - a[0].first;
    linecd.first = a[3].first - a[2].first;
    lineab.second = a[1].second - a[0].second;
    linecd.second = a[3].second - a[2].second;
    if (cross(lineab,linecd) == 0) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  
  
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
    double x[4];
    double y[4];
    int n;
    cin >> n;
    while(n--){
        for(int i=0; i<4; i++){
            cin >> x[i] >> y[i];
        }
        double d1,d2;
        d1 = (y[1]-y[0])/(x[1]-x[0]);
        d2 = (y[3]-y[2])/(x[3]-x[2]);
        if(d1==d2) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>

typedef long long Int;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
using namespace std;

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

	REP(i, n){

		double p[8];
		REP(i, 8){
			cin >> p[i];
		}

		double dx1 = (p[0] - p[2]);
		double dx2 = (p[4] - p[6]);
		double dy1 = (p[1] - p[3]);
		double dy2 = (p[5] - p[7]);


		if (!dx1||!dx2){
			cout << "NO" << endl;
			continue;
		}

		string ans = (dy2/dx2 == dy1/dx1) ? "YES" : "NO";


		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-11
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<double,double> P;
static const int INF=1<<24;

int main(){
	double x[5],y[5];
	int n;
	cin>>n;
	rep(i,n){
		rep(j,4){
			cin>>x[j]>>y[j];
			//cout<<j<<" = "<<x[j]<<" "<<y[j]<<endl;
		}
		P a=P( x[1]-x[0] ,y[1]-y[0]), b=P( x[3]-x[2] ,y[3]-y[2]);
		bool f;
		if(abs(a.F*b.S-b.F*a.S)==0) f=true;
		else f=false;
		//printf("%.13f %.13f\n",a.F,b.S);
		//CP c(3.0,2.0);
		//cout<<real(c)<<" "<<imag(c)<<endl;
		//cout<<real(a)<<" "<<imag(a)<<" "<<real(b)<<" "<<imag(b)<<endl;
		if(f) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}