Pagini recente » Cod sursa (job #1655244) | Cod sursa (job #139972) | Cod sursa (job #2914937) | Cod sursa (job #2885721) | Cod sursa (job #1810027)
#include <fstream>
using namespace std;
ifstream fin("carte2.in");
ofstream fout("carte2.out");
bool is_possible(short a, short b, short c, short d, short e) {
if ((c > a and d > b) or (c > b and d > a))
return true;
if ((c > a and e > b) or (c > b and e > a))
return true;
if ((d > a and e > b) or (d > b and e > a))
return true;
return false;
}
int main()
{
short t;
fin >> t;
for (int i = 1; i <= t; ++i) {
short a, b, c, d, e;
fin >> a >> b >> c >> d >> e;
fout << (is_possible(a, b, c, d, e) ? "posibil\n" : "imposibil\n");
}
return 0;
}