Pagini recente » Profil gabi_bodirlau | Monitorul de evaluare | Istoria paginii utilizator/roman_59 | Profil ordogfioka | Cod sursa (job #1708899)
#include <bits/stdc++.h>
using namespace std;
vector <int> v;
int a, b, c, d, e, t;
int main() {
ifstream f("carte2.in");
ofstream g("carte2.out");
f>>t;
while(t--) {
f>>a>>b>>c>>d>>e;
v.clear();
v.push_back(a);
v.push_back(b);
v.push_back(0);
sort(v.begin(), v.end());
bool ok = false;
do {
if(v[0] < c && v[1] < d && v[2] < e)
ok = true;
} while(next_permutation(v.begin(), v.end()));
g<<(ok? "posibil\n":"imposibil\n");
}
return 0;
}