#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include using namespace std; int main() { int Q; cin >> Q; while (Q--) { long long a[4]; //for (int i = 0; i < 4; ++i) scanf("%lld", &a[i]); cin >> a[0] >> a[1] >> a[2] >> a[3]; long long max = 0; int maxIndex; bool zero = false; for (int i = 0; i < 4; ++i) { if (a[i] == 0) zero = true; if (a[i] > max) { max = a[i]; maxIndex = i; } } bool overflowed = false; long long sum = 0, sumBefore = 0; for (int i = 0; i < 4; ++i) if (i != maxIndex) { sum += a[i]; if (sum < sumBefore) overflowed = true; sumBefore = sum; } if (!zero && (overflowed || sum > max)) printf("Yes\n"); else printf("No\n"); } #ifndef ONLINE_JUDGE system("pause"); #endif return 0; }