#include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

signed 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;
  double AB=(y2-y1)/(x2-x1);
  double CD=(y4-y3)/(x4-x3);

  AB*=100000;
  AB/=100000.0;
  CD*=100000;
  CD/=100000.0;
  cout<<(AB==CD?"YES":"NO")<<endl;
  
  }
  return 0;
}