Cod sursa(job #1528794)

Utilizator CostanMiriamCostan Miriam CostanMiriam Data 20 noiembrie 2015 01:40:51
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include<fstream>
#include<algorithm>

using namespace std;

ifstream fin("chatnoir.in");
ofstream fout("chatnoir.out");

int main() {

    int testsCount;

    fin >> testsCount;

    while(testsCount--) {

        int n, m, x, y;

        fin >> n >> m >> x >> y;

        fout << (min(x, min(y, min(n - x + 1, m - y + 1))) <= 5 ? "DA\n" : "NU\n");

    }

    return 0;

}

//Miriam e tare!