Cod sursa(job #2547413)

Utilizator ililogIlinca ililog Data 15 februarie 2020 12:29:45
Problema Carte2 Scor 100
Compilator cpp-64 Status done
Runda Arhiva ICPC Marime 0.89 kb
using namespace std;
#include<iostream>
#include<fstream>

ifstream fin("carte2.in");
ofstream fout("carte2.out");

int t, a,b,c,d,e;

void rezolvare(int a, int b, int c, int d, int e) {
    if (a<c && b<d) {
        fout << "posibil \n";
        return;
    }

    if (a<d && b<c) {
        fout << "posibil \n";
        return;
    }

    if (a<d && b<e) {
        fout << "posibil \n";
        return;
    }

    if (a<e && b<d) {
        fout << "posibil \n";
        return;
    }

    if (a<c && b<e) {
        fout << "posibil \n";
        return;
    }

    if (a<e && b<c) {
        fout << "posibil \n";
        return;
    }

    fout << "imposibil \n";
}

int main() {

    fin >> t;

    for (int i = 1; i<=t; i++) {
        fin >> a >> b >> c >> d >> e;

        rezolvare(a,b,c,d,e);
    }

    fin.close();
    fout.close();

    return 0;
}