Pagini recente » Cod sursa (job #348047) | Cod sursa (job #995780) | Monitorul de evaluare | Cod sursa (job #386475) | Cod sursa (job #1709098)
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <queue>
#include <string>
#include <limits>
#include <vector>
#include <bitset>
#include <utility>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#define MOD 10001 // daca e nevoie de mod
#define oo 2000000000
#define ooLL (1LL<<60)
#define LSB(x) (x&(-x)) // least significat bit of
#define eps 0.00001
typedef long long ull;
typedef long double ld;
int main()
{
std::ifstream cin("carte2.in");
std::ofstream cout("carte2.out");
int test_count;
cin >> test_count;
for (auto test_idx = 0; test_idx < test_count; ++test_idx) {
short A, B, C, D, E;
cin >> A >> B >> C >> D >> E;
bool posibil = false;
if (A < D && B < C) { // cxd
posibil = true;
cout << "posibil\n";
} else if (A < E && B < D) { // dxe
posibil = true;
cout << "posibil\n";
} else if (A < C && B < E) { // exc
posibil = true;
cout << "posibil\n";
} else if (A < C && B < D) { // cxd
posibil = true;
cout << "posibil\n";
} else if (A < D && B < E) { // dxe
posibil = true;
cout << "posibil\n";
} else if (A < E && B < C) { // exc
posibil = true;
cout << "posibil\n";
} else {
cout << "imposibil\n";
}
}
return 0;
}