#include #include #include // #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVL; typedef vector VVI; typedef pair P; typedef pair PL; double x1, x2, x3; double y1, y2, y3; double calc(double t){ return (x1 - x2 + (y1 - y2) * t) * (x3- x2 + (y3 - y2) * t); } bool solve(){ if (x1 == x3 && y1 == y3) return false; if (calc(0) > 1e-10) return true; if (calc(1e18) > 1e10) return true; // cout << "well"; double le = 0, ri = 1e18; REP(_,200){ // cout << le << " " << ri << endl; double m1 = (2 * le + ri) / 3.0, m2 = (le + 2 * ri) / 3.0; if (calc(m1) > calc(m2)) ri = m2; else le = m1; } // cout << le << endl; return calc(le) > 1e-10; } int main() { int n; cin >> n; while (n--){ cin >> x1 >> x2 >> x3 >> y1 >> y2 >> y3; cout << (solve() ? "YES" : "NO") << endl; } return 0; }