#include #include #include using namespace std; double x[3], y[3]; int n; int main() { cin >> n; for (; n > 0; n--) { for (int i = 0; i < 3; i++)cin >> x[i]; for (int i = 0; i < 3; i++)cin >> y[i]; if (!((x[0] >= x[1] && x[1] >= x[2]) || (x[0] <= x[1] && x[1] <= x[2]))) { cout << "YES" << endl; continue; } if (y[0] != y[1] && (x[1] - x[0]) / (y[0] - y[1])>=0) { cout << "YES" << endl; continue; } if (y[1] != y[2] && (x[2] - x[1]) / (y[1] - y[2])>=0) { cout << "YES" << endl; continue; } cout << "NO" << endl; } return 0; }