Pagini recente » Cod sursa (job #1533782) | Cod sursa (job #48767) | Cod sursa (job #1518485) | Cod sursa (job #2533526) | Cod sursa (job #1466784)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("amlei.in");
ofstream fout("amlei.out");
void solve(const int &n, int &a, const int &lim){
bool good;
int x;
for(int i = 1; i <= lim; i++){
good = true;
for(int j = 1; j <= n; j++){
fin >> x;
if(x < 0){
good = false;
a = max(0, a);
}
}
if(good == true){
a = 1;
}
}
}
int main(){
int n, t, u, a, b;
while(fin >> n){
fin >> t >> u;
a = b = -1;
solve(n, a, t);
solve(n, b, u);
if(a == b){
fout << "DA\n";
} else {
fout << "NU\n";
}
}
return 0;
}