Pagini recente » Borderou de evaluare (job #435713) | Istoria paginii utilizator/radu202 | Atasamentele paginii Profil 5claudiac52100fL5 | Borderou de evaluare (job #1780692) | Cod sursa (job #2239971)
#include <fstream>
using namespace std;
ifstream in("chatnoir.out");
ofstream out("chatnoir.out");
int teste;
int n, m, x, y;
const int MAX_Dist = 5;
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;
}