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 <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int i,j,k,T;
  cin>>T;
  while(T--){
    double xx,yy,EPS=1e-9;
    ll x[4],y[4];
    rep(i,4){
      cin>>xx>>yy;
      x[i]=xx*1e5+EPS;
      y[i]=yy*1e5+EPS;
      //   cout<<x[i]<<","<<y[i]<<endl;
    }cout<<1e5<<endl;
    rep(i,2){
      x[i*2+1]-=x[i*2];
      y[i*2+1]-=y[i*2];
    }
    cout<<(x[1]*y[3]==x[3]*y[1]?"YES":"NO")<<endl;
  }
  return 0;
}

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

int main()
{
    int n;
    double x1,y1,x2,y2,x3,y3,x4,y4;

    cin >> n;

    //a(x1,y1) b(x2,y2) c(x3,y3) d(x4,y4)
    for( int i = 0; i < n; i++ )
    {   
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

        double px, py, qx, qy;
        px = x2 - x1;
        py = y2 - y1;
        qx = x4 - x3;
        qy = y4 - y3;

        if( fabs( px * qy - py * qx ) < 1e-10 )
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
 
int main()
{
    int n;
    cin >> n;
    for (int i = 0 ; i < n ; i++)
    {
        long double x[4],y[4],s,t;
        cin >> x[0] >>y[0] >>x[1] >>y[1] >>x[2] >>y[2] >>x[3] >>y[3];
        s = (y[1]-y[0])*(x[3]-x[2]);
        t = (y[3]-y[2])*(x[1]-x[0]);
       // if ((abs((y[0]-y[1])/(x[0]-x[1]))) == (abs((y[2]-y[3])/(x[2]-x[3]))))
        if (s == t)
        {
          cout <<"YES" <<endl; 
        } else
        {
          cout <<"NO" <<endl;
        }  
    }
 
     
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n;cin>>n;
	for(;n--;)
	{
		float a,b,c,d,e,f,g,h;cin>>a>>b>>c>>d>>e>>f>>g>>h;
		if(abs(c-a)<1e-8||abs(g-e)<1e-8)cout<<(abs(c-a)<1e-8&&abs(g-e)<1e-8?"YES":"NO")<<endl;
		else cout<<(abs((d-b)*(g-e)-(h-f)*(c-a))<1e-8?"YES":"NO")<<endl;
	}
}

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

int main(){

	typedef struct{
		double x, y;
	}_td;

	int n;
	_td p1, p2, p3, p4, v_ab, v_cd;
	double del, eps;
	eps = 0.000001;
	
	cin >> n;
	
	for(int i=0; i<n; i++){
		cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y >> p4.x >> p4.y;
	
		v_ab.x = p2.x - p1.x;
		v_ab.y = p2.y - p1.y;
		v_cd.x = p4.x - p3.x;
		v_cd.y = p4.y - p3.y;
		
		del = v_ab.x * v_cd.y - v_ab.y * v_cd.x;
		if(abs(del) < eps) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;

}

C++: #include<cstdio>

int n;
double point[4][2];

int main()
{
	scanf("%d",&n);
	for(int k=0;k<n;k++)
	{
	for(int i=0;i<4;i++)
	{
		for(int j=0;j<2;j++)
		{
			scanf("%lf",&point[i][j]);
		}
	}

	if((point[0][0]-point[1][0])*(point[2][1]-point[3][1])==(point[0][1]-point[1][1])*(point[2][0]-point[3][0])||(point[0][0]-point[1][0])*(point[2][1]-point[3][1])==(point[0][1]-point[1][1])*(point[2][0]-point[3][0]))
	{
		printf("YES\n");
	}
	else printf("NO\n");
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cctype>
#include <vector>
#include <complex>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

typedef vector<int> vi;
typedef long long ll;
typedef complex<double> vec;

double cross(const vec& a, const vec& b) {
  return imag(conj(a)*b);
}

int main(){
    int n;
    cin >> n;
    rep(_,n){
        double q,w,e,r,t,y,u,i;
        cin >> q>>w>>e>>r>>t>>y>>u>>i;
        vec a(q-e, w-r);
        vec b(t-u, y-i);
        double x = cross(a,b);
        if(abs(x)<1e-9){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

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

#define eps 0.000001

int main()
{
    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;
    
        vector<double> v1, v2;
        v1.push_back(x2 - x1);
        v1.push_back(y2 - y1);
        v2.push_back(x4 - x3);
        v2.push_back(y4 - y3);
    
        double r1, r2;
        r1 = v1.at(1)/v1.at(0);
        r2 = v2.at(1)/v2.at(0);

        if( fabs(r1-r2) < eps ) cout << "YES\n";
        else cout << "NO\n";
    }
    return 0;
}

C++: #include <complex>
#include <iostream>
#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 i=0; i<N; ++i) {
		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]))/2 < 0;
		cout << ( p ? "Yes" : "No") << endl;
	}
}