Cod sursa(job #1708958)

Utilizator lookingForAChallengeUBB Cociorva Popoveniuc Salajan lookingForAChallenge Data 28 mai 2016 10:22:39
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 1 kb
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<ld, ld>
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second

int a[5], b[5];

int main() {
    cin.sync_with_stdio(false);

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

    int t;
    cin >> t;

    for (; t; t--) {
        cin >> a[0] >> a[1] >> b[0] >> b[1] >> b[2];

        bool ok = 0;
        for (int i = 0; i < 2; i++)
            for (int j = 0; j < 2; j++)
                if (i != j)
                    for (int k = 0; k < 3; k++)
                        for (int l = 0; l < 3; l++)
                            if (k != l)
                                if (a[i] < b[k] && a[j] < b[l])
                                    ok = 1;

        if (ok)
            cout << "posibil\n";
        else
            cout << "imposibil\n";
    }

    return 0;
}