Cod sursa(job #1708954)

Utilizator ALL10iUPB ALL10i ALL10i Data 28 mai 2016 10:21:54
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.44 kb
#include <iostream>
#include <fstream>
#include <algorithm>

using namespace std;

int main ()
{
	int T;
	ifstream f("carte2.in");
	ofstream g("carte2.out");
	
	f >> T;
	for (;T>0;--T) {
		int A, B, C, D, E;
		f >> A >> B;
		if (A < B)
			swap(A, B);
		f >> C >> D >> E;
		if (C < D)
			swap(C, D);
		if (D < E)
			swap(D, E);
		if (C < D)
			swap(C, D);
		if ((A < C) && (B < D))
			g << "posibil\n";
		else
			g << "imposibil\n";
	}

	return 0;
}