Cod sursa(job #1708910)

Utilizator UBB_HakunaMatataUBB Cozma Nechita Pop UBB_HakunaMatata Data 28 mai 2016 10:12:56
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.65 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("carte2.in");
ofstream fout("carte2.out");


int main()
{
    int t, a, b, c, d, e, ok;
    fin >> t;
    while(t--)
    {
        fin >> a >> b >> c >> d >> e;
        ok = 0;
        if(a < c && b < d)
            ok = 1;
        if(a < d && b < c)
            ok = 1;
        if(a < c && b < e)
            ok = 1;
        if(a < e && b < c)
            ok = 1;
        if(a < d && b < e)
            ok = 1;
        if(a < e && b < d)
            ok = 1;
        if(ok)
            fout << "posibil\n";
        else
            fout << "imposibil\n";
    }
}