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 <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int l = 0; l < n; l++) {
		double x[4], y[4], v[2];
		for (int i = 0; i < 4; i++) {
			cin >> x[i] >> y[i];
			x[i]*=100000;
			y[i]*=100000;
		}
		v[0] = (y[1] - y[0]) / (x[1] - x[0]);
		v[1] = (y[3] - y[2]) / (x[3] - x[2]);
		if (x[0] == x[1] && x[2] == x[3]) {
			cout << "YES" << endl;
			continue;
		} else if (x[0] == x[1] || x[2] == x[3]) {
			cout << "NO" << endl;
			continue;
		} else if (v[0] == v[1]) {
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
		continue;
	}
	return 0;
}

C++: #include <stdio.h>
#include <complex>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef complex<double> P;
#define EPS (1e-12)

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

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        double x1, y1, x2, y2, x3, y3, x4, y4;
        scanf("%lf%lf", &x1, &y1);
        scanf("%lf%lf", &x2, &y2);
        scanf("%lf%lf", &x3, &y3);
        scanf("%lf%lf", &x4, &y4);
        const bool a = (fabs(cross(P(x1-x2, y1-y2), P(x3-x4, y3-y4))) < EPS);
        puts(a ? "YES" : "NO");
    }
    return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;

int main(){

	int n;
	cin>>n;
	double x1,y1,x2,y2,x3,y3,x4,y4;
	double a,b;
	while(n>0){
		
	cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		
		a=(y2-y1)/(x2-x1);
		b=(y4-y3)/(x4-x3);
		
		if(a==b)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
		
		n--;
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int n;
	cin >> n;

	double x1, y1, x2, y2, x3, y3, x4, y4;

	while (n--){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if ((x2 - x1 == 0) && (x4 - x3 == 0)) cout << "YES\n";
		else
		cout << ((((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) == 0) ? "YES\n" : "NO\n");
	}

	return 0;
}

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

int main()
{
    double a,s,d,f,g,h,j,k;
    double q,w,e,r;
        int n;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>a>>s>>d>>f>>g>>h>>j>>k;
        q=d-a;
    w=f-s;
    e=j-g;
    r=k-h;
        int key=q*r-w*e;
        if(!key)cout<<"YES"<<endl;
        else  cout<<"NO"<<endl;
    }
    return 0;
}

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		double x[4], y[4];
		double a, b;
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		a = (x[2] - x[3]) * (y[0] - y[1]);
		b = (x[0] - x[1]) * (y[2] - y[3]);
		bool h = abs(a - b) < 0.0000001;
		if (h)
		{
			cout << "YES" << endl;
		}
		else
			cout << "NO" << endl;
	}




	return 0;
}

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

int judge(double a1,double a2,double b1,double b2,double c1,double c2,double d1,double d2);

int main(){
	int n;
	double a1,a2,b1,b2;
	double c1,c2,d1,d2;
	
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2;
		if(judge(a1,a2,b1,b2,c1,c2,d1,d2))
			cout<<"YES"<<endl; 
		else
			cout<<"NO"<<endl;
	}

}


int judge(double a1,double a2,double b1,double b2,double c1,double c2,double d1,double d2){
	double aa,bb;
	aa=(b2-a2)/(b1-a1);
	bb=(d2-c2)/(d1-c1);
//	cout<<aa<<" "<<bb<<endl;
	if(aa==bb)return 1; else return 0;
}

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

int main() {
	int N;
	cin>>N;
	for(;N--;){
		double x1,y1,x2,y2,x3,y3,x4,y4;
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		if(x2-x1!=0&&x4-x3!=0){
			double a1=(y2-y1)/(x2-x1);
			double a2=(y4-y3)/(x4-x3);
			if(a1==a2) cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}else if(x2-x1==0&&x4-x3==0)
			cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

C++: #include<iostream>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ;  i++)
int main(void){
	int n;
	cin>>n;
	rep(k,n){
		double x[4];
		double y[4];
		rep(i,4)cin>>x[i]>>y[i];
    
		if(((y[1]-y[0])/(x[1]-x[0])) ==((y[3]-y[2])/(x[3]-x[2])))cout<<"YES";
		else cout<<"NO";
		cout<<endl;
	}
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)

#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif

#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

#define ALL(c) (c).begin(),(c).end()

#define DBG0(x)    {if(DEBUG){ cout << #x << ": " << x << "\t"; }}
#define DBG(x)     {if(DEBUG){DBG0(x); cout << endl;}}
#define DBG2(x, y) {if(DEBUG){DBG0(x); DBG(y);}}
#define DBG3(x, y, z) {if(DEBUG){DBG0(x); DBG2(y, z);}}
#define DBG4(w, x, y, z) {if(DEBUG){DBG0(w); DBG3(x, y, z);}}

const double EPS = 1.0e-9;
template <class T>
ostream& operator<<(ostream& os, vector<T> xs){ for(T x: xs) os << x << ' '; return os; }
template <class S, class T>
ostream& operator<<(ostream& os, pair<S,T> st){ os << "(" << st.first << "," << st.second <<")"; return os; }

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

typedef complex<double> Point;
istream& operator>>(istream& is, Point &pt){
    double a, b;
    is >> a >> b;
    pt.real(a); pt.imag(b);
    return is;
}

ostream& operator<<(ostream& os, const Point &pt){
    os << make_pair(pt.real(), pt.imag());
    return os;
}

inline double cross(const Point &a, const Point &b){
    return (a.real()*b.imag() - a.imag()*b.real());
}

inline double myarg(Point &a){
    double ret = arg(a);
    return (ret >= 0 ? ret : ret + 2*M_PI);
}

inline double signed_area(const Point &a, const Point &b, const Point &c){
    Point ab = b - a;
    Point ac = c - a;
    return cross(ab, ac) / 2.0;
}

inline bool intersect(const Point &a1, const Point &a2, const Point &b1, const Point &b2) {
    return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) &&
            (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS));
}

void sort_by_arg(vector<Point> &pts){
    sort(pts.begin(), pts.end(), [](Point a, Point b){ return (myarg(a) < myarg(b)); });
}

double area(vector<Point> &vs){
    int n = vs.size();
    vector<Point> pts(n - 1);
    rep(i, n - 1) pts[i] = vs[i + 1] - vs[0];
    sort_by_arg(pts);
    double ans = 0.0;
    rep(i, n - 1) ans += cross(vs[i], vs[i + 1]);
    return ans / 2.0;
}

int main(void){

    int n;
    cin >> n;
    while(n-->0){
        Point a,b,c,d;
        cin >> a >> b >> c >> d;
//        DBG4(a, b, c, d);
//        DBG(cross(b - a, d - c));
        if((cross(b - a, d - c)) < EPS)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}