Pagini recente » Cod sursa (job #1137412) | Cod sursa (job #326625) | Cod sursa (job #2706535)
#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
using namespace std;
ifstream fin("carte2.in");
ofstream fout("carte2.out");
const int N = 5;
int T, A, B, v[N];
bool Check(int l, int c)
{
for (int i = 1; i <= 3; i++)
{
for (int j = 1; j <= 3; j++)
{
if (i != j)
{
if ((l < v[i] && c < v[j]) || (c < v[i] && l < v[j]))
return true;
}
}
}
return false;
}
int main()
{
fin >> T;
while (T--)
{
fin >> A >> B >> v[1] >> v[2] >> v[3];
if (Check(A, B))
fout << "posibil" << '\n';
else
fout << "imposibil" << '\n';
}
}