Cod sursa(job #1758019)

Utilizator xSliveSergiu xSlive Data 16 septembrie 2016 12:03:37
Problema Carte2 Scor 100
Compilator cpp Status done
Runda Arhiva ICPC Marime 0.6 kb
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;

ifstream f("carte2.in");
ofstream g("carte2.out");

int main() {
    int t;
    vector<int> book(2,0);
    vector<int> box(3,0);
    f >> t;

    for (int i = 0; i < t; i++) {
        f >> book[0] >> book[1];
        f >> box[0] >> box[1] >> box[2];
        sort(book.begin(), book.end());
        sort(box.begin(), box.end());
        if (box[2] > book[1] && box[1] > book[0])
            g << "posibil" << endl;
        else g << "imposibil" << endl;
    }

    f.close();
    g.close();

    return 0;

}