Cod sursa(job #678830)

Utilizator cdascaluDascalu Cristian cdascalu Data 12 februarie 2012 14:16:22
Problema ChatNoir Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <stdio.h>

using namespace std;

int main()
{
    FILE*f = fopen("chatnoir.in","r");
    int p,n,m,x,y;
    fscanf(f,"%d",&p);
    FILE*g = fopen("chatnoir.out","w");
    while(p--)
    {
        fscanf(f,"%d%d%d%d",&n,&m,&x,&y);
        if(x-1>=4 && n-x>=4 && y-1>=4 && m-y>=4)
            fprintf(g,"NU\n");
        else
            fprintf(g,"DA\n");
    }
    fclose(f);
    fclose(g);
    return 0;
}