Cod sursa(job #1709107)

Utilizator UTCN_rachetaUTCN Pocol Rogoz Oltean UTCN_racheta Data 28 mai 2016 10:55:42
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.6 kb
#include <iostream>
#include <fstream>

using namespace std;

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

    int T, A, B, C, D, E;
    bool OK;

    f >> T;

    while (T -- )
    {
        OK = false;

        f >> A >> B >> C >> D >> E;

        if (((A < C)  && (B < D)) || ((A < D) && (B < C))) OK = true;
        if (((A < E)  && (B < D)) || ((A < D) && (B < E))) OK = true;
        if (((A < E)  && (B < C)) || ((A < C) && (B < E))) OK = true;

        if (OK) g << "posibil";
        else g << "imposibil";
        g << "\n";
    }
    return 0;
}