Cod sursa(job #2088683)

Utilizator Steve_ITStefan Ursache Steve_IT Data 15 decembrie 2017 18:08:50
Problema Carte2 Scor 100
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.48 kb
#include <fstream>
#include <algorithm>
using namespace std;
ifstream f("carte2.in");
ofstream g("carte2.out");
int n, i, v[5], a, b;
int main()
{
    f>>n;
    for(i=1; i<=n; i++) {
        f>>a>>b>>v[1]>>v[2]>>v[3];
        sort(v+1, v+4);
        if(b>a) swap(a, b);
        if(a<v[3] and (b<v[2] or b<v[1]))
            g<<"posibil";
        else if(a<v[2] and b<v[1])
            g<<"posibil";
        else g<<"imposibil";
        g<<'\n';
    }
    return 0;
}