Cod sursa(job #1710127)

Utilizator alexpetrescuAlexandru Petrescu alexpetrescu Data 28 mai 2016 16:04:21
Problema Carte2 Scor 100
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.61 kb
#include <cstdio>
inline bool ok(int a, int b, int x, int y){
    if(((a<x)&&(b<y))||((a<y)&&(b<x))) return true;
    else return false;
}
int main(){
    int a, b, c, d, e, t;
    FILE *fin, *fout;
    fin=fopen("carte2.in", "r");
    fout=fopen("carte2.out", "w");
    fscanf(fin, "%d", &t);
    for(; t; t--){
        fscanf(fin, "%d%d%d%d%d", &a, &b, &c, &d, &e);
        if((ok(a, b, c, d))||(ok(a, b, c, e))||(ok(a, b, d, e))){
            fprintf(fout, "posibil\n");
        }else{
            fprintf(fout, "imposibil\n");
        }
    }
    fclose(fin);
    fclose(fout);
    return 0;
}