P10245 题解
前言
你说得对,但是百度 YYDS!
思路
首先假设
代码
# include <bits/stdc++.h>
using namespace std;
int t, a, b, c, d;
bool f (int a, int b, int c) {
return a + b > c && a + c > b && b + c > a;
}
bool check (int& a, int& b, int& c, int& d) {
return f (abs (a - c), b, d);
}
int main () {
ios::sync_with_stdio (0);
cin.tie (0);
cout.tie (0);
cin >> t;
while (t --) {
cin >> a >> b >> c >> d;
cout << (check (a, b, c, d) || check (b, c, d, a) ? "yes\n" : "no\n");
}
return 0;
}