Cod sursa(job #1736566)

Utilizator andreey_047Andrei Maxim andreey_047 Data 1 august 2016 23:52:24
Problema Carte2 Scor 0
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.99 kb
#include <bits/stdc++.h>

using namespace std;

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

int main(){
    ifstream f("carte2.in");
    ofstream g("carte2.out");
    f >> T;
    while(T--){
        f >> a >> b >> c >> d >> e;
        int x = c, y = d;
        if(a < c && b < d){
            g << "posibil\n";
            continue;
        }
        swap(c,d);
        if(a < c && b < d){
            g << "posibil\n";
            continue;
        }
        swap(c,e);
        if(a < c && b < d){
            g << "posibil\n";
            continue;
        }
        c = x , d = y;
    swap(a,b);
    if(a < c && b < d){
            cout << "posibil\n";
            continue;
        }
        swap(c,d);
        if(a < c && b < d){
            g << "posibil\n";
            continue;
        }
        swap(c,e);
        if(a < c && b < d){
            g << "posibil\n";
            continue;
        }
        g << "imposibil\n";
    }

    f.close();
    g.close();
    return 0;
}