Cod sursa(job #1708892)

Utilizator cojocarugabiReality cojocarugabi Data 28 mai 2016 10:08:02
Problema Carte2 Scor 100
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 1.08 kb
# include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define db long double
# define scn(x) scanf("%I64d",&x)
# define scan(x) scanf("%d",&x)
# define print(x) printf("%d ",x)
# define prnt(x) printf("%I64d ",x);
# define eol printf("\n")
# define IOS ios_base :: sync_with_stdio(0)
# define pe "Possible"
# define ie "Impossible"
# define halt(...) {fo << (__VA_ARGS__) << '\n';exit(0);}
# define rep(n) for (int qwerty = 1;qwerty <= n;++qwerty)
# define pp(n) cerr << #n << " = " << n << '\n'
# define ppp(v) for (auto it : v) cerr << it << ' ';cerr << '\n'
const int mod = 1e9 + 7;
int main(void)
{
    auto ok = [](int a,int b,int c,int d)
    {
        return (a < c && b < d) || (a < d && b < c);
    };
    int t;
    ifstream fi("carte2.in");
    ofstream fo("carte2.out");
    fi>>t;
    while (t --)
    {
        int a,b,c,d,e;
        fi>>a>>b>>c>>d>>e;
        fo << (ok(a,b,c,d) || ok(a,b,d,e) || ok(a,b,c,e) ? "posibil":"imposibil") << '\n';
    }
    return 0;
}