2825 - Chenar 2
Rezolvare
<syntaxhighlight lang="python" line="1"> n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(n)] x = int(input())
for i in range(n):
for j in range(m): if i == 0 or i == n-1 or j == 0 or j == m-1: if a[i][j] == x: print("DA") exit()
print("NU") </syntaxhighlight>