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 <stdio.h>

int
main(void)
{
	char line[100];
	int n;

	if (fgets(line, sizeof line, stdin) == NULL) {
		return 1;
	}
	if (sscanf(line, "%d", &n) != 1) {
		return 1;
	}

	for (int i = 0; i < n; i++) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			return 1;
		}
		
		double x1, y1, x2, y2, x3, y3, x4, y4;
		
		if (sscanf(line, "%lf %lf %lf %lf %lf %lf %lf %lf",
				   &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) == 8) {
			double ab = (y2 - y1)/(x2 - x1);
			double cd = (y4 - y3)/(x4 - x3);
			
			printf("%s\n", ((ab == cd) ? "YES" : "NO"));
		}
		
	}

	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;



inline double dot(const P &a, const P &b) {
	return (conj(a) * b).real();
}


int main(){
	int n; cin >> n;
	while (n--) {
		P ps[4];
		rep(i, 4) {
			double x, y; cin >> x >> y;
			ps[i] = P(x, y);
		}
		cout << (dot(ps[0] - ps[1], ps[2] * P(0, 1) - ps[3] * P(0, 1)) == 0 ? "YES" : "NO") << endl;
	}
	
	return 0;
}

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

int main(){
	double N,xx,yy;
	long long X[5],Y[5];
	cin>>N;
	for(int j=1;j<=N;j++){
		for(int i=1;i<=4;i++){
			cin>>xx>>yy;
			X[i]=(int)(xx*100000.0);
			Y[i]=(int)(yy*100000.0);
		}
		if((X[2]-X[1])*(Y[4]-Y[3])==(X[4]-X[3])*(Y[2]-Y[1])){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	float x[4], y[4];
	cin >> n;

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

		float l1, l2;
		l1 = (y[1] - y[0]) / (x[1] - x[0]);
		l2 = (y[3] - y[2]) / (x[3] - x[2]);
		if (l1 == l2){
			cout << "YES" << endl;
		}

		else {
			cout << "NO" << endl;
		}
	}
	return (0);
}

C++: #include "geometry/intersect.hpp"

void solve() {
  Line p, q;
  cin >> p >> q;
  cout << (intersect<true>(p, q) ? "NO" : "YES") << endl;
}

int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) solve();
}

C++: #include <bits/stdc++.h>

using namespace std;

#define EPS 1e-10
#define equals(a, b) (fabs(a - b) < EPS)

struct Point {
    double x, y;

    Point(){}
    Point(double x, double y) : x(x), y(y) {}
 
    Point operator - (const Point &p) const {  return Point(x - p.x, y - p.y); }
};

typedef Point Vector;

double cross(const Point &a, const Point &b)
{
    return a.x * b.y - b.x * a.y;
}

struct Line {
    Point s, t;
    Line(){}
    Line(Point s, Point t) : s(s), t(t) {}
};

bool isParallelSS(const Line &s1, const Line &s2)
{
    Vector a = s1.t - s1.s;
    Vector b = s2.t - s2.s;
    return equals(cross(a, b), 0);
}

istream &operator >> (istream &is, Point &p)
{
    return is >> p.x >> p.y;
}

int main()
{
    int N;
    Line l[2];
    cin >> N;
    while (N--) {
        for (int i = 0; i < 2; i++) {
            cin >> l[i].s >> l[i].t;
        }
        cout << (isParallelSS(l[0], l[1]) ? "YES" : "NO") << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int z = 0; z < n; z++) {
		long float x1, x2, x3,y1, y2, y3, y4, x4 ;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if (y1 > y2) {
			swap(y1, y2);
			swap(x1, x2);
		}
		if (y3 > y4) {
			swap(y3, y4);
			swap(x3, x4);
		}
		if ((x1 > x2&&x3 > x4 && ((y2 - y1) / (x1 - x2) == (y4 - y3) / (x3 - x4))) || (x2 > x1&&x4 > x3 && ((y1 - y2) / (x2 - x1) == (y3 - y4) / (x4 - x3)))) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include<iostream>
 
using namespace std;
 
int main(void)
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        double x1,y1,x2,y2,x3,y3,x4,y4;
        cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
        double a1,a2;
        a1=(y2-y1)/(x2-x1);
        a2=(y4-y3)/(x4-x3);
        if(a1==a2)
        {
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}