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>
#include <string> 
using namespace std;

int main(){
	float x1,x2,x3,x4,y1,y2,y3,y4;
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
			scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		if( ((y1-y2)==0&&(y3-y4)!=0&&(x1-x2)==0&&(x3-x4)!=0) || ((x1-x2)!=0&&(x3-x4)==0&&(y1-y2)==0&&(y3-y4)!=0)){
			
				printf("NO\n");
		}
			else if((y1-y2)*(x3-x4)==(x1-x2)*(y3-y4)){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}
	
	return 0;
}

C++: /*AOJ 0021*/

#include<iostream>
using namespace std;

class point_obj{
public:
	double x,y;
};

int main(){

	int n;
	point_obj p[4];


	cin>>n;

	for(int i=0;i<n;i++){

		for(int j=0;j<4;j++){
			cin>>p[j].x;
			cin>>p[j].y;
		}

		if( p[1].x - p[0].x == 0){
			if(p[3].x-p[2].x == 0){
				cout<<"YES"<<endl;
			}

			else{
				cout<<"NO"<<endl;
			}

		}

		else{
			double tmp0 = (p[1].y - p[0].y)/(p[1].x - p[0].x);
			if(p[3].x-p[2].x == 0){
				cout<<"NO"<<endl;
			}
			else{
				double tmp1 = (p[3].y - p[2].y)/(p[3].x-p[2].x);
				if(tmp0 == tmp1){
					cout<<"YES"<<endl;
				}
				else{
					cout<<"NO"<<endl;
				}
			}
		}
	}

	return 0;
}

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

#define infinity INT_MAX

int main()
{
	int n;
	std::cin >> n;
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double at_x_zero_ab, at_x_zero_cd;
	double slope_ab, slope_cd;
	for (int i = 0; i < n; i++) {
		std::cin >> x1 >> y1 >> x2 >> y2
                 >> x3 >> y3 >> x4 >> y4;
		if (x2 -x1 == 0) {
			slope_ab = infinity;
		} else {
			slope_ab = (y2 - y1) / (x2 - x1);
		}
		if (x4 - x3 == 0) {
			slope_cd = infinity;
		} else {
			slope_cd = (y4 - y3) / (x4 - x3);
		}
		at_x_zero_ab = y1 - slope_ab * x1;
		at_x_zero_cd = y3 - slope_cd * x3;
		if (slope_ab == slope_cd && slope_ab != infinity) {
			if (at_x_zero_ab == at_x_zero_cd) {
				std::cout << "NO\n";
			} else {
				std::cout << "YES\n";
			}
		} else if (slope_ab == slope_cd && slope_ab == infinity) {
			if (x1 == x3) {
				std::cout << "NO\n";
			} else {
				std::cout << "YES\n";
			}
		} else {
			std::cout << "NO\n";
		}
	}
	return 0;
}