Cod sursa(job #1709716)

Utilizator radu_cebotariRadu Cebotari radu_cebotari Data 28 mai 2016 13:34:32
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.5 kb
#include<fstream>
using namespace std;
ifstream in("carte2.in");
ofstream out("carte2.out");

int a,b,c,d,e;

int main()
{
    int T;
    in>>T;
    for(; T ; --T){
        in>>a>>b>>c>>d>>e;
        if(a > b)
            swap(a,b);
        if(e < d)
            swap(e,d);
        if(d < c)
            swap(c,d);
        if(d > e)
            swap(d,e);
        if(b < e && a < d)
            out<<"posibil\n";
        else
            out<<"imposibil\n";
    }
    return 0;

}