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 <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) {
  return (conj(a) * b).imag();
}

const double eps = 1e-11;
double x[4], y[4];
int N;
int main() {
  cin >> N;
  for (int t = 0; t < N; ++t) {
    for (int i = 0; i < 4; ++i) {
      cin >> x[i] >> y[i];
    }
    xy_t a[2] = {
      xy_t(x[0], y[0]) - xy_t(x[1], y[1]),
      xy_t(x[2], y[2]) - xy_t(x[3], y[3])
    };
    bool p = abs(cross_product(a[0], a[1])) < eps;
    cout << (p ? "YES" : "NO") << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

void q21() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		double ax, ay, bx, by, cx, cy, dx, dy;
		cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy;
		if (bx - ax == 0 || dx - cx == 0) {
			if (bx - ax == dx - cx) {
				cout << "YES" << endl;
				continue;
			}
		}
		else if (abs((by - ay) / (bx - ax) - (dy - cy) / (dx - cx)) <= 0.00001 ){
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
	}
}

int main() {
	q21();
	return 0;
}

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

#define P complex<double>

int main(){
  int n;
  P a,b,c,d;

  cin >> n;
  for( int loop=0;loop<n;loop++ ){
    cin >> a.real() >> a.imag();
    cin >> b.real() >> b.imag();
    cin >> c.real() >> c.imag();
    cin >> d.real() >> d.imag();

    P x=a-b, y=c-d;
    x = x/abs(x);
    y = y/abs(y);

    if( x==y || x==-y )
      /*
      abs(x.real()-y.real()) < 1.0e-4  &&
	abs(x.imag()-y.imag()) < 1.0e-4  )
      */
      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 = 999999, cd = 999999;
		ab = (y[0]-y[1]) / (x[0]-x[1]);
		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 <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>
using namespace std;

int main(){
    double e = 0.00000000001;
    double x[4];
    double y[4];
    double s;
    double t;
    double u;
    double v;
    double m;
    int n;
    cin >> n;

    for (int t = 0;t < n;++t) {
        for (int i = 0;i < 4;++i){
            cin >> x[i] >> y[i]; 
        }
    }
    s = x[1] - x[0];
    t = y[1] - y[0];
    u = x[3] - x[2];
    v = y[3] - y[2];

    if(s * v - t * u > 0){
        double m = s * v - t * u;
    }
    else{
        double m = t * u - s * v;
    }

    if(m < e){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<long long> xy_t;

xy_t P[4];

long long cross(xy_t p,xy_t q){
    return (conj(p)*q).imag();
}

int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        for(int j=0;j<4;++j){
            double x,y;
            cin>>x>>y;
            P[j]=xy_t(100000*x,100000*y);
        }
        
        xy_t a[2]={
            P[0]-P[1],
            P[2]-P[3]
        };

        bool flag=(abs(cross(a[0],a[1]))==0);

        cout<<(flag?"YES":"NO")<<"\n";

    }
}

C++: #include<iostream>
using namespace std;
int main(){
	double ax[100],ay[100],bx[100],by[100],cx[100],cy[100],dx[100],dy[100];
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>ax[i]>>ay[i]>>bx[i]>>by[i]>>cx[i]>>cy[i]>>dx[i]>>dy[i];
	}
	for(int i=0;i<n;i++){
		double A=0,B=0;
		A=(by[i]-ay[i])/(bx[i]-ax[i]);
		B=(dy[i]-cy[i])/(dx[i]-cx[i]);
		if(A==B){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
}

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();
}