Cod sursa(job #1312122)
Utilizator | Data | 8 ianuarie 2015 22:13:04 | |
---|---|---|---|
Problema | ChatNoir | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in ("chatnoir.in");
ofstream out ("chatnoir.out");
bool sol(int n, int m, int x, int y) {
return ( min( min(x - 1, y - 1), min(n - x, m - y) ) <= 4 );
}
void rezolva() {
int t, n, m, x, y;
in >> t;
while ( t-- ) {
in >> n >> m >> x >> y;
if ( sol(n, m, x, y) ) out << "DA\n";
else out << "NU\n";
}
}
int main() {
rezolva();
return 0;
}