Cod sursa(job #635324)

Utilizator cont_de_testeCont Teste cont_de_teste Data 19 noiembrie 2011 10:22:45
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda .com 2011 Marime 0.49 kb
#include <fstream>
using namespace std;

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

int t, n, m, x, y;
int main()
{
    for (f >> t; t > 0; --t)
    {
        //dist == 5
        f >> n >> m >> x >> y;
        int c1 = x, c2 = y, c3 = n - x + 1, c4 = m - y + 1;
        int mn = c1;
        if (mn > c2) mn = c2;
        if (mn > c3) mn = c3;
        if (mn > c4) mn = c4;
        if (mn > 5) g << "NU\n";
        else g << "DA\n";
    }
    g.close();
    return 0;
}