Cod sursa(job #1709098)

Utilizator cpitting_llamasRotaru Tanase Gherghina cpitting_llamas Data 28 mai 2016 10:53:44
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 1.26 kb
#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;
}