//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<complex>

using namespace std;

#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<int, int> pii;

// const ll inf = INT_MAX;
const double eps = 1e-5;
const double pi = acos(-1.0);
const int di[][2] = {{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};

int main(){
	int n;
	scanf("%d\n", &n);
	double x[4], y[4];
	rep(i,n){
		rep(j,4){
			scanf("%lf %lf", &x[j], &y[j]);
		}
		double dx[2], dy[2];
		dx[0] = x[1] - x[0];
		dx[1] = x[3] - x[2];
		dy[0] = y[1] - y[0];
		dy[1] = y[3] - y[2];
		printf("%lf\n",std::abs(dy[1]*dx[0] - dy[0]*dx[1]));
		if(std::abs(dy[1]*dx[0] - dy[0]*dx[1]) <= eps) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}