Pagini recente » Borderou de evaluare (job #2352058) | Monitorul de evaluare | Borderou de evaluare (job #438266) | Diferente pentru utilizator/tudalex intre reviziile 24 si 28 | Cod sursa (job #2239969)
#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;
}