Cod sursa(job #1484239)

Utilizator akaprosAna Kapros akapros Data 10 septembrie 2015 17:05:13
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int t, n, m, x, y;
int main()
{
    int minv;
    freopen("chatnoir.in", "r", stdin);
    freopen("chatnoir.out", "w", stdout);
    scanf("%d", &t);
    while (t --)
    {
        scanf("%d %d %d %d", &n, &m, &x, &y);
        minv = min(min(x - 1, n - x), min(y - 1, m - y));
        if (minv <= 4)
            printf("DA\n");
        else
            printf("NU\n");
    }
    return 0;
}