Cod sursa(job #2105227)

Utilizator Steve_ITStefan Ursache Steve_IT Data 12 ianuarie 2018 20:55:29
Problema Carte2 Scor 100
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.66 kb
#include <fstream>
#include <algorithm>

using namespace std;

ifstream f ("carte2.in");
ofstream g ("carte2.out");

int n, i, a, b, v[6];
int cmp(int a, int b) {
    return b<a;
}

int main()
{
    f>>n;
    for(i=1; i<=n; i++) {
        f>>a>>b>>v[1]>>v[2]>>v[3];
        sort(v+1, v+4, cmp);
        if(a<b) swap(a, b);
        if(a<v[1])
            if(b<v[2] or b<v[3])
                g<<"posibil"<<'\n';
            else
                g<<"imposibil"<<'\n';
        else if(a<v[2])
            if(b<v[3])
                g<<"posibil"<<'\n';
            else g<<"imposibil"<<'\n';
        else g<<"imposibil"<<'\n';
    }
    return 0;
}