Cod sursa(job #1709760)
Utilizator | Data | 28 mai 2016 13:47:44 | |
---|---|---|---|
Problema | Carte2 | Scor | 100 |
Compilator | cpp | Status | done |
Runda | ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest | Marime | 1.18 kb |
#include <fstream>
using namespace std;
ifstream cin("carte2.in");
ofstream cout("carte2.out");
int T, a, b, c, d, e;
int main() {
cin >> T;
while(T--) {
cin >> a >> b >> c >> d >> e;
if(a < d && b < c){
cout << "posibil\n";
}
else {
if(a < d && b < e) {
cout << "posibil\n";
}
else {
if(a < c && b < e) {
cout << "posibil\n";
}
else {
if(b < d && a < c){
cout << "posibil\n";
}
else {
if(b < d && a < e) {
cout << "posibil\n";
}
else {
if(b < c && a < e) {
cout << "posibil\n";
}
else {
cout << "imposibil\n";
}
}
}
}
}
}
}
return 0;
}