#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> x[i]; rep(i, 0, 3) cin >> y[i]; vector v; v.push_back(0); rep(i, 0, 3) rep(j, 0, 3) if (i != j and x[i] < x[j] and y[i] > y[j]) { double ng = 0, ok = 2020; rep(k, 0, 100) { double md = (ng + ok) / 2; double xi = x[i] + y[i] * md; double xj = x[j] + y[j] * md; if (xi > xj) ok = md; else ng = md; } v.push_back(ok); } set w; fore(t, v) { w.insert(t - 0.01); w.insert(t); w.insert(t + 0.01); } fore(t, w) if(0 <= t) { rep(i, 0, 3) xx[i] = x[i] + y[i] * t; int ok = 0; if (xx[0] < xx[1] and xx[2] < xx[1]) ok = 1; if (xx[0] > xx[1] and xx[2] > xx[1]) ok = 1; if (ok) return "YES"; } return "NO"; } //--------------------------------------------------------------------------------------------------- void _main() { int N; cin >> N; rep(i, 0, N) printf("%s\n", solve().c_str()); }