Pagini recente » Cod sursa (job #2649841) | Cod sursa (job #1128954) | Cod sursa (job #1241610) | Cod sursa (job #661758) | Cod sursa (job #1709358)
#include <fstream>
using namespace std;
ifstream fin("carte2.in");
ofstream fout("carte2.out");
bool fits(int boxX, int boxY, int bookX, int bookY)
{
if (bookX < boxX && bookY < boxY)
{
return true;
}
if (bookX < boxY && bookY < boxX)
{
return true;
}
return false;
}
int main()
{
int T; fin >> T;
for (int t = 0; t < T; t++)
{
int A, B, C, D, E;
fin >> A >> B >> C >> D >> E;
// dimesion C x D of the box
if (fits(C, D, A, B))
{
fout << "posibil" << '\n';
continue;
}
// dimesion C x D of the box
if (fits(D, E, A, B))
{
fout << "posibil" << '\n';
continue;
}
// dimesion C x D of the box
if (fits(E, C, A, B))
{
fout << "posibil" << '\n';
continue;
}
fout << "imposibil" << '\n';
}
return 0;
}