#include using namespace std; using ll = long long; using vec = pair; vec input_vec(){ ll x, y; cin >> x >> y; return vec(x,y); } vec minus_vec(vec a, vec b){ a.first -= b.first; a.second -= b.second; return a; } bool parallel_same_dir(vec a, vec b){ ll cr = a.first * b.second - a.second * b.first; if (cr != 0) return false; ll dt = a.first * b.first + a.second * b.second; return dt > 0; } ll norm_vec(vec a){ return a.first*a.first + a.second*a.second; } void solve(){ vec p1 = input_vec(); vec p2 = input_vec(); vec q1 = input_vec(); vec q2 = input_vec(); vec p12 = minus_vec(p2,p1); vec q12 = minus_vec(q2,q1); if (!parallel_same_dir(p12,q12)){ cout << "No" << endl; } else if (p12 == q12 && p1 == q1){ cout << "Yes" << endl; } else if (norm_vec(p12) <= norm_vec(q12)){ cout << "No" << endl; } else { cout << "Yes" << endl; } } int main(){ int t; cin >> t; while (t--){ solve(); } }