Pagini recente » Cod sursa (job #957936) | Cod sursa (job #2313136) | Cod sursa (job #1363120) | Cod sursa (job #745826) | Cod sursa (job #635324)
Cod sursa(job #635324)
#include <fstream>
using namespace std;
ifstream f("chatnoir.in");
ofstream g("chatnoir.out");
int t, n, m, x, y;
int main()
{
for (f >> t; t > 0; --t)
{
//dist == 5
f >> n >> m >> x >> y;
int c1 = x, c2 = y, c3 = n - x + 1, c4 = m - y + 1;
int mn = c1;
if (mn > c2) mn = c2;
if (mn > c3) mn = c3;
if (mn > c4) mn = c4;
if (mn > 5) g << "NU\n";
else g << "DA\n";
}
g.close();
return 0;
}