Cod sursa(job #1708963)

Utilizator echipa_BoSSilorUNIBUC Harsan Bicsi Baltatu echipa_BoSSilor Data 28 mai 2016 10:23:56
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 1.28 kb
/*************************************************************\
~*********************ENJOY THE SILENCE***********************~
\*************************************************************/

#include <bits/stdc++.h>
using namespace std;

/*******************Debugging defines*************************/

#define ok_dump() cerr<<"OK\n"
#define var_dump(x) cerr<<#x": "<<x<<'\n'
#define arr_dump(x, n) {cerr<<#x"[]: ";\
	for(int _=0;_<n;++_) cerr<<x[_]<<" ";cerr<<'\n';}

/*************************************************************/

const int MAXN = 500000;
int A[MAXN], Count[MAXN], Ret[MAXN];

int main() {	
//	assert(freopen("input.txt", "r", stdin));
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ifstream fin("carte2.in");
	ofstream fout("carte2.out");

	int t;
	fin >> t;
	while(t--) {
		vector<int> X(3);
		int a, b;

		fin >> a >> b;
		fin >> X[0] >> X[1] >> X[2];
	
		sort(X.begin(), X.end());

		bool ok = false;
		do {
			if(a < X[0] && b < X[1]) {
				ok = true;
				break;
			}
		} while(next_permutation(X.begin(), X.end()));

		fout << (ok ? "posibil\n" : "imposibil\n");
	}
	
	return 0;
}

/*************************************************************\
~*********************ENJOY THE SILENCE***********************~
\*************************************************************/