#include using namespace std; using ll = long long; using i64 = long long; #define var auto int main() { cin.tie(0)->sync_with_stdio(false); int t; cin >> t; while (t --> 0) { ll x1, y1, x2, y2, gx1, gy1, gx2, gy2; cin >> x1 >> y1 >> x2 >> y2 >> gx1 >> gy1 >> gx2 >> gy2; x1 -= x2; y1 -= y2; gx1 -= gx2; gy1 -= gy2; if (x1 < 0) { x1 *= -1; gx1 *= -1; } if (y1 < 0) { y1 *= -1; gy1 *= -1; } bool ok = x1 * gy1 == y1 * gx1 && 0 <= gx1 && gx1 <= x1 && 0 <= gy1 && gy1 <= y1 && !(gx1 == x1 && gy1 == y1); cout << (ok ? "Yes" : "No") << endl; } }