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 <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;


#define rep(i,n) for(int i=0;i<(n);i++)

const double EPS = 1e-10;
const double INF = 100000000;




int main(){
    int n;
    cin>>n;
    rep(i,n){
        double x[4],y[4],ax,ay,bx,by,ans;
        
        rep(j,4){
            cin>>x[j]>>y[j];
        }
        
        ax=x[1]-x[0];
        ay=y[1]-y[0];
        bx=x[3]-x[2];
        by=y[3]-y[2];
        
        ans=ax*by-bx*ay;
        if(fabs(ans)<=EPS)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
        
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

struct Vector
{
	double x;
	double y;
};

istream& operator>>(istream& stream, Vector& p)
{
	return stream >> p.x >> p.y;
}

double slope(Vector p1, Vector p2)
{
	return (p2.y - p1.y) / (p2.x - p1.x);
}

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

	while(length-- > 0)
	{
		Vector a, b, c, d;
		cin >> a >> b >> c >> d;

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

	return 0;
}