Cod sursa(job #1708887)

Utilizator UCV_Buleandra_Teodorescu_BadeaUCV TEODORESCU BADEA CIUREZ UCV_Buleandra_Teodorescu_Badea Data 28 mai 2016 10:06:04
Problema Carte2 Scor 0
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.55 kb
#include <iostream>
#include <cstdio>

using namespace std;

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

bool check(int X, int Y) {
    return (A < X && B < Y) || (A < Y && B < X);
}
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);

        bool ok = 0;
        ok |= check(C, D);
        ok |= check(D, E);
        ok |= check(C, E);

        if(ok) printf("posibil\n");
        else printf("imposibil");
    }
    return 0;
}