#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long int ll mod = 1000000007; //typedef vector V; //typedef vector VV; //typedef vector VVV; int main() { int n; double a, b, c, A, B, C; cin >> n; for (int i = 0; i < n; i++) { cin >> a >> b >> c >> A >> B >> C; if (B - A == 0 && C - B == 0) { if (a < b&&c < b && !(A == C && a == c)) { cout << "YES" << endl; } else cout << "NO" << endl; } else if (B - A == 0) { if (a < b && !(A == C && a == c)) { cout << "YES" << endl; } else cout << "NO" << endl; } else if (C - B == 0) { if (c < b && !(A == C && a == c)) { cout << "YES" << endl; } else cout << "NO" << endl; } else { if (!(A == C && a == c) && !(B == C && b == c)) { if ((B - A) < 0 && ( B-C) > 0) { if ((b - c) / (C - B)<(a - b) / (B - A) ) { cout << "YES" << endl; } else cout << "NO" << endl; } else if ((B - A) > 0 && ( B-C) < 0) { if ((c - b) / (B - C) > (b - a) / (A - B)){ cout << "YES" << endl; } else cout << "NO" << endl; } else if ((B - A) <0 && ( B-C) < 0) { if (b - c > 0 && b - a > 0) { cout << "YES" << endl; } else cout << "NO" << endl; }else{ cout << "YES" << endl; } } else cout << "NO" << endl; } } }