Cod sursa(job #874058)

Utilizator bogdan353Costea Bogdan bogdan353 Data 7 februarie 2013 21:01:49
Problema ChatNoir Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>


using namespace std;

int T, x , y , N , M ;

int main()
{
	ifstream f("chatnoir.in");
	ofstream g("chatnoir.out");
	
	
	f>>T;
	
	for( int i = 1 ; i <= T ; ++i )
	{
		f >> N >> M >> x >> y ;
		
		bool ok = 0;
		
		if( M - y + 1 <= 4 )
			ok = 1 ;
		if( x <= 4)
			ok = 1 ;
		if( N - x + 1 <= 4 )
			ok = 1 ;
		if( y <= 4 )
			ok = 1 ;
		
		
		if( ok == 1 ) g<<"DA"<<"\n";
		else g<<"NU"<<"\n";
		
	}
	
	f.close();
	g.close();
	
	return 0;
}