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 <stdio.h>
 
#include <math.h>
 
int hantei(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4);
 
int main(){
     
    double x1,x2,x3,x4,y1,y2,y3,y4;
     
    int result=0,i,n;
     
    scanf("%d",&n);
     
    for(i=0;i<n;i++){
         
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
         
        result= hantei(x1,y1,x2,y2,x3,y3,x4,y4);
         
        if(result==1){
             
            puts("YES");
             
        }else puts("NO");
         
    }
     
     
     
     
     
    return 0;
     
}
 
int hantei(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
     
    double kata1,kata2;
     
    kata1=(y1-y2)/(x1-x2);
     
    kata2=(y3-y4)/(x3-x4);
     
    if(kata1==kata2){
         
        return 1;
         
    }else{
         
        return 0;
         
    }  
     
}

C++: 
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int main(void){
    int n;
    double x[4],y[4],a,b,c,d,det;
    cin >> n;
    rep(j,n) {

    
    //入力を多少簡略化
    for(int i=0;i<4;i++) {
        cin >> x[i];
        cin >> y[i];
    }
    //(x1,y1)(x2,y2)を結ぶax+by=p の係数
    a = y[0]-y[1];  b = x[1]-x[0];
    //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
    c = y[2]-y[3];  d = x[3]-x[2];
    //係数についての行列式
    det = a*d-c*b;
    if(fabs(det) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;
    }
}

C++: 
#include <iostream>
#include <complex>
#include <cmath>

using namespace std;

typedef complex<double> Point;

bool parallel(const Point &v1, const Point &v2) {
    double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
    double n = norm(v1) * norm(v2);
    return abs(dot*dot - n) < 1e-4;
}

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ps[4];
        for(int i = 0; i < 4; ++i) cin >> ps[i].real() >> ps[i].imag();
        Point v1 = ps[1]-ps[0], v2 = ps[3]-ps[2];

        if(parallel(v1, v2) && !parallel(v1, ps[2]-ps[1])) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}