Cod sursa(job #1708998)
Utilizator | Data | 28 mai 2016 10:30:28 | |
---|---|---|---|
Problema | Carte2 | Scor | 100 |
Compilator | cpp | Status | done |
Runda | ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest | 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;
}