Cod sursa(job #1810027)

Utilizator DeehoroEjkoliPop Darian DeehoroEjkoli Data 19 noiembrie 2016 15:35:43
Problema Carte2 Scor 100
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.64 kb
#include <fstream>
using namespace std;
ifstream fin("carte2.in");
ofstream fout("carte2.out");

bool is_possible(short a, short b, short c, short d, short e) {
    if ((c > a and d > b) or (c > b and d > a))
        return true;
    if ((c > a and e > b) or (c > b and e > a))
        return true;
    if ((d > a and e > b) or (d > b and e > a))
        return true;
    return false;
}

int main()
{
    short t;
    fin >> t;
    for (int i = 1; i <= t; ++i) {
        short a, b, c, d, e;
        fin >> a >> b >> c >> d >> e;
        fout << (is_possible(a, b, c, d, e) ? "posibil\n" : "imposibil\n");
    }
    return 0;
}