#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--){ long long x1,y1,x2,y2,X1,Y1,X2,Y2; cin >> x1 >> y1 >> x2 >> y2 >> X1 >> Y1 >> X2 >> Y2; if(x1 == X1 && y1 == Y1 && x2 == X2 && y2 == Y2){cout << "Yes" << endl; continue;} long long dx2 = X2-X1,dy2 = Y2-Y1,dx1 = x2-x1,dy1 = y2-y1; long long D = dx1*dx1+dy1*dy1,A = dx2*dx2+dy2*dy2; if(D <= A){cout << "No" << endl; continue;} if((dx1 < 0 && dx2 > 0) || (dx1 > 0 && dx2 < 0) || (dy1 < 0 && dy2 > 0) || (dy1 > 0 && dy2 < 0)){cout << "No" << endl; continue;} if((dx1 == 0 && dx2 != 0) || (dx1 != 0 && dx2 == 0) || (dy1 == 0 && dy2 != 0) || (dy1 != 0 && dy2 == 0)){cout << "No" << endl; continue;} if(dx1*dy2 == dx2*dy1) cout << "Yes" << endl; else cout << "No" << endl; } }