#include #include #include #include double m_pi; using namespace std; const double eps = 1e-7; bool between(double a, double b, double x) { return (a - eps < x) && (x < b + eps); } struct angles { double first, second; angles(double a, double b) : first(a), second(b) { if (first < 0 ) first += 2*m_pi; if (second < 0 ) second += 2*m_pi; if (first > 2*m_pi) first -= 2*m_pi; if (second > 2*m_pi) second -= 2*m_pi; if (first < second && second - first < m_pi || first > second && first - second > m_pi) { double t = first; first = second; second = t; } if (first > second-eps) second += 2*m_pi; } angles() {} void normalize() { if (first >= 2*m_pi && second >= 2*m_pi) { first -= 2*m_pi; second -= 2*m_pi; } if (first < 0) { first += 2*m_pi; second += 2*m_pi; } } bool fits(double x) { while (x - 2*m_pi > first) x-=2*m_pi; while (x <= second+eps) { if (between(first, second, x)) return true; x += 2*m_pi; } return false; } }; struct line { double a, b, c; line() {}; line(double a, double b, double c) : a(a),b(b),c(c) { normalize(); } void normalize() { double d = sqrt(a*a + b*b); a /= d; b /= d; c /= d; } }; ostream & operator << (ostream & o, angles const & a) { o << a.first <<' '<= 2*m_pi) alpha -=2*m_pi; for (int i = 0; i != 4; ++i) if (!an[i].fits(alpha)) return false; return true; } bool check(angles * an1, angles * an2, double alpha, double beta) { return check(an1, alpha) && check(an2, beta); } bool anless(angles const & a, angles const & b) { if (a.first < b.first) return true; if (a.first > b.first) return false; return a.second < b.second; } bool solve() { double a,b,c; double a1,b1,c1; cin >> a >> b >> c >> a1 >> b1 >> c1; if (a > b) swap(a, b); if (a1 > b1) swap(a1, b1); double p = (a+b+c)/2; double h = 2*sqrt(p*(p-a)*(p-b)*(p-c))/a; int i = 0; line l[4]; l[0] = line(0, 1, h/2); l[1] = line(0, 1, -h/2); double k = sqrt(b*b-h*h); l[2] = getLine((a+k)/2, h/2, (a-k)/2,-h/2); l[3] = getLine(-(a+k)/2, -h/2, -(a-k)/2,h/2); angles an[8]; double d1 = c1/2; double d2 = sqrt(2*a1*a1+2*b1*b1-c1*c1)/2; if (d1 > d2) swap(d1, d2); double alpha = acos((d1*d1+d2*d2-a1*a1)/(2*d1*d2)); int j = 0; for (i = 0;i != 4; ++i) { an[i] = getValid(l[i], d1); an[4+i] = getValid(l[i], d2); an[4+i].first += alpha; an[4+i].second += alpha; an[4+i].normalize(); } double all[17]; j = 0; sort(an, an + 8, anless); for (i = 0;i != 8;++i) { all[j++] = an[i].first; all[j++] = an[i].second; } sort(all, all+16); all[16] = all[0]+2*m_pi; for (i = 0; i < 16;++i) { double x = 5.0069904867236339; for (j = 0;j != 8;++j) if (!an[j].fits(x)) break; if (j == 8) return true; for (j = 0;j != 8;++j) if (!an[j].fits(all[i])) break; if (j == 8) return true; } return false; } int main() { m_pi = atan2(0, -1); int cases; cin >> cases; while (cases--) { if (solve()) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }