Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	for i := 0; i < n; i++ {
		scanner.Scan()
		points := strings.Split(scanner.Text(), " ")
		fpoints := make([]float64, 0)
		for _, v := range points {
			tmp, _ := strconv.ParseFloat(v, 64)
			fpoints = append(fpoints, tmp)
		}
		a := (fpoints[1]-fpoints[3])/(fpoints[0]-fpoints[2])
		b := (fpoints[5]-fpoints[7])/(fpoints[4]-fpoints[6])
		if a == b {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

using namespace std;

typedef complex<double> Point;

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];
        double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
        double n = norm(v1) * norm(v2);
        if(abs(dot*dot - n) < 1e-5) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<stdio.h>

int main(void){
	int n,i;
	float ax,ay,bx,by,cx,cy,dx,dy;
	float datax_1,datax_2,datay_1,datay_2;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f %f %f",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy);
		datax_1=bx-ax;
		datax_2=dx-cx;
		datay_1=by-ay;
		datay_2=dy-cy;
		if(datax_1==datax_2 && datay_1==datay_2)
			printf("YES\n");
		else if(datax_1*(-1)==datax_2 && datay_1*(-1)==datay_2)
			printf("YES\n");
		else
			printf("No\n");
	}

	return 0;
}

C++: #include<stdio.h>
int main(){
	int n,i;
	float x1,y1,x2,y2,x3,y3,x4,y4;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f%f%f%f%f%f%f%f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		if(((x2-x1)/(x4-x3))==((y2-y1)/(y4-y3))){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

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

int main() {
	double x[4],y[4],N;
	cin>>N;
	while(N--){
		for(int i=0;i<4;i++) cin>>x[i]>>y[i];
		if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1]))
		cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		float x[4], y[4];
		for(int j = 0; j < 4; j++){
			cin >> x[j] >> y[j];
		}
		float ab = 99999999, cd = 99999999;
		if(x[0] != x[1]) ab = (y[0]-y[1]) / (x[0]-x[1]);
		if(x[2] != x[3]) cd = (y[2]-y[3]) / (x[2]-x[3]);
		if(ab == cd) cout << "YES"<< endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;

typedef complex<double> Point;

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];
        /*
        double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
        double n = norm(v1) * norm(v2);
        if(abs(dot*dot - n) < 1e-5) cout << "YES" << endl;
        else cout << "NO" << endl;
        */
        if(abs(arg(v1)-arg(v2)) < 1e-2) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
struct Coordinate {
	double x;
	double y;
};
vector<bool>l;
int main() {
	Coordinate A, B, C, D;
	double Inclination_of_AB;
	double Inclination_of_CD;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> A.x >> A.y >> B.x >> B.y;
		Inclination_of_AB = (B.x - A.x) / (B.y - A.y);
		cin >> C.x >> C.y >> D.x >> D.y;
		Inclination_of_CD = (D.x - C.x) / (D.y - C.y);
		l.push_back(Inclination_of_AB == Inclination_of_CD);
	}
	for (bool i : l) {
		if (i) cout << "YES";
		else cout << "NO";
		cout << std::endl;
	}
	char c;
	cin >> c;
}

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

int main() {

  int n;
  cin >> n;

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

    double x[4],y[4];
    cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];

    if ( ( x[0] - x[1] ) * ( x[2] - x[3] ) == 0.00 ) {

      if ( x[0] == x[1] && x[2] == x[3] ) {
	cout << "YES" << endl;
      }else {
	cout << "NO" << endl;
      }

    }else {

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

    }

  }

  return 0;

}