Cod sursa(job #2239969)

Utilizator PondorastiAlex Turcanu Pondorasti Data 12 septembrie 2018 08:59:22
Problema ChatNoir Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.61 kb
#include <fstream>

using namespace std;

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


int teste;
int n, m, x, y;

const int MAX_Dist = 4;
const string da = "DA\n", nu = "NU\n";

int main() {
    
    in >> teste;
    
    while (teste--) {
        in >> n >> m >> x >> y;
        
        if (x - 1 <= MAX_Dist) {
            out << da;
        } else if (y - 1 <= MAX_Dist) {
            out << da;
        } else if (n - x <= MAX_Dist) {
            out << da;
        } else if (m - y <= MAX_Dist) {
            out << da;
        } else {
            out << nu;
        }
    }
    
    return 0;
}