Cod sursa(job #1708904)

Utilizator UTCN_TBDUTCN Furdui Moldovan Militaru UTCN_TBD Data 28 mai 2016 10:11:45
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.5 kb
#include <fstream>
using namespace std;

ifstream fin("carte2.in");
ofstream fout("carte2.out");

int main()
{
	int t;
	int a, b, c, d, e;
	fin >> t;
	bool ok;
	for (int tt = 0; tt < t; tt++) {
		fin >> a >> b >> c >> d >> e;
		ok = false;
		if (a < c && (b < d || b < e)) {
			ok = true;
		}
		if (a < d && (b < c || b < e)) {
			ok = true;
		}
		if (a < e && (b < c || b < d)) {
			ok = true;
		}
		if (ok) {
			fout << "posibil\n";
		}
		else {
			fout << "imposibil\n";
		}
	}
}