Cod sursa(job #1708922)

Utilizator UTCN_FrunzaUTCN Lazar Nitu Petruta UTCN_Frunza Data 28 mai 2016 10:14:58
Problema Carte2 Scor 0
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.81 kb
#include <bits/stdc++.h>

#define POSIBIL "posibil\n"
#define IMPOSIBIL "imposibil\n"

using namespace std;

int tests, a, b, c, d, e;

int main() {
    //freopen("B.in", "r", stdin);

    scanf("%d", &tests);

    for (int test = 0; test < tests; ++test) {
        scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);

        //c x d
        if ((a < c && b < d) || (a < d && b < c)) {
            printf("%s", POSIBIL);
            continue;
        }

        // c x e
        if ((a < c && b < e) || (a < e && b < c)) {
            printf("%s", POSIBIL);
            continue;
        }

        // d x e
        if ((a < d && b < e) || (a < e && b < d)) {
            printf("%s", POSIBIL);
            continue;
        }

        printf("%s", IMPOSIBIL);
        continue;
    }

    return 0;
}