fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t; cin>>t;
  6. while(t--) {
  7. vector<int> v;
  8. int a,b,c,d;
  9. cin>>a>>b>>c>>d;
  10. v.push_back(a); v.push_back(b);
  11. v.push_back(c); v.push_back(d);
  12. sort(v.begin(),v.end());
  13. int f = max(a,b), g = max(c,d);
  14. string flag = "NO";
  15. if(f==v[3] || f==v[2]) {
  16. if(g == v[3] || g==v[2]) {
  17. flag = "YES";
  18. }
  19. }
  20. cout<<flag<<endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5280KB
stdin
4
3 7 9 5
4 5 6 9
5 3 8 1
6 5 3 2
stdout
YES
NO
YES
NO