Cod sursa(job #3363107)

Utilizator CorvinJudge0Corvin Judge CorvinJudge0 Data 14 august 2026 09:28:41
Problema ChatNoir Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>

using namespace std;

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

int check(int n, int m, int xx, int yy){
    if((xx <= 4 || n - xx <= 4) && (yy <= 4 || m - yy <= 4)){
        return 1;
    }
    return 0;
}

int main(){
    int tests; in>>tests; 
    for(; tests > 0; tests--){
        int n, m, xx, yy;
        in>>n>>m>>xx>>yy;

        out<<(check(n, m, xx, yy) ? "DA\n" : "NU\n");
    }
    return 0;
}