#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

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

