Cod sursa(job #1708953)

Utilizator UTCN_heapstrUTCN HeapStr UTCN_heapstr Data 28 mai 2016 10:21:09
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.84 kb
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <string.h>
#include <math.h>
#include<iostream>
int t;
using namespace std;
int a, b, c, d, e;
int main(){
	freopen("carte2.in", "r", stdin);
		freopen("carte2.out", "w", stdout);

	scanf("%d", &t);
	vector<int> v;
	for (int u = 1; u <= t; u++)
	{
		v.clear();
		v.resize(3);
		scanf("%d %d", &a, &b);
		scanf("%d %d %d", &v[0], &v[1], &v[2]);

		if (a > b) swap(a, b);
		sort(v.begin(), v.end());


		if (a < v[0] && b < v[1]) {
			printf("posibil\n");
			continue;
		}
		if (a < v[1] && b < v[2]) {
			printf("posibil\n");
			continue;
		}
		if (a < v[0] && b < v[2]) {
			printf("posibil\n");
			continue;
		}

		printf("imposibil\n");
	}


	return 0;
}