Cod sursa(job #1138361)

Utilizator robertstrecheStreche Robert robertstreche Data 9 martie 2014 21:41:59
Problema ChatNoir Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <fstream>

using namespace std;

ifstream f("chatnoir.in");
ofstream g("chatnoir.out");

long long t,n,m,l,c,i;

long long iese(int n,int m,int l,int c)
{
    if (l<=5)
     return 1;
    if (c<=5)
     return 1;
    if (n-l<=4)
     return 1;
    if (m-c<=4)
     return 1;

    return 0;
}

int main()
{
    f>>t;

     for (i=1;i<=t;i++)
      {
          f>>n>>m>>l>>c;

          if (iese(n,m,l,c)==1)
           g<<"DA\n";
          else
           g<<"NU\n";
      }

   f.close();
   g.close();
}