Cod sursa(job #1689936)

Utilizator iordache.bogdanIordache Ioan-Bogdan iordache.bogdan Data 14 aprilie 2016 17:26:01
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<fstream>
#include<algorithm>

using namespace std;

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

int main() {

	int testsCount;

	fin >> testsCount;

	while (testsCount--) {

		int n, m, x, y;

		fin >> n >> m >> x >> y;

		fout << (min(x, min(y, min(n - x + 1, m - y + 1))) <= 5 ? "DA\n" : "NU\n");

	}

	return 0;

}

//Trust me, I'm the Doctor!