Cod sursa(job #1171855)

Utilizator ThomasFMI Suditu Thomas Thomas Data 16 aprilie 2014 15:01:27
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include <fstream>
#include <algorithm>
using namespace std;

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

int main()
{
    int t,n,m,x,y;
    f>>t;
    while(t--)
    {
        f>>n>>m>>x>>y;
        if(min( min(x-1, y-1) , min(n-x, m-y) ) <= 4) g<<"DA\n";
        else g<<"NU\n";
    }
    
    f.close();
    g.close();
}