mfgnik

Untitled

May 13th, 2020
1,358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. m, n = map(int, input().split())
  2. a = [[0] * 8 for h in range(8)]
  3. a[n - 1][m - 1] = 1
  4. for i in range(n, 8):
  5.     for j in range(8):
  6.         if 0 < j < 7:
  7.             a[i][j] = a[i - 1][j - 1] + a[i - 1][j + 1]
  8.         elif j:
  9.             a[i][j] = a[i - 1][j - 1]
  10.         else:
  11.             a[i][j] = a[i - 1][j + 1]
  12. print(sum(a[-1]))
Advertisement
Add Comment
Please, Sign In to add comment