Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int a, b, c, d;
cin>a>>b>>c>>d;
if(max(a, b) > min(c, d) && max(c, d) > min(a, b)){
cout<<"YES"<<endl;
continue;
}
cout<<"NO"<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
4
3 7 9 5
4 5 6 9
5 3 8 1
6 5 3 2
3 7 9 5
4 5 6 9
5 3 8 1
6 5 3 2
Output
YES
NO
YES
NO
NO
YES
NO
Demonstration
Codeforcess Solution 1535-A A. Fair Playoff ,C++, Java, Js and Python,1535-A,Codeforcess Solution