Cod sursa(job #1708918)

Utilizator TeamFIIAUAIC FIIHumvee TeamFIIA Data 28 mai 2016 10:14:04
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.86 kb
#include <iostream>
#include <map>
#include <cstdio>
#include <string>
#include <set>
#include <algorithm>
#include <vector>

#define DMAX 100001

using namespace std;

int T, A, B, C, D, E;

int verifica(int a, int b, int c, int d, int e)
{
    if(a < c && b < d)
        return 1;
    if(a < d && b < e)
        return 1;
    if(a < c && b < e)
        return 1;
    if(b < c && a < d)
        return 1;
    if(b < d && a < e)
        return 1;
    if(b < c && a < e)
        return 1;
    return 0;
}

int main()
{
    freopen("carte2.in", "r", stdin);
    freopen("carte2.out", "w", stdout);

    scanf("%d", &T);
    while(T--)
    {
        scanf("%d%d%d%d%d", &A, &B, &C, &D, &E);
        if(verifica(A, B, C, D, E))
            printf("posibil\n");
        else
            printf("imposibil\n");
    }

    return 0;
}