Cod sursa(job #1625667)

Utilizator eu3neuomManghiuc Teodor-Florin eu3neuom Data 2 martie 2016 20:07:50
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <bits/stdc++.h>

using namespace std;

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

int main(){
    int t, x, y, a, b, dx, dy;
    fin >> t;
    while(t--){
        fin >> x >> y >> a >> b;
        dx = min(x - a, a - 1);
        dy = min(y - b, b - 1);
        if(min(dx, dy) < 5){
            fout << "DA\n";
        } else {
            fout << "NU\n";
        }
    }
    return 0;
}