Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m, n = map(int, input().split())
- a = [[0] * 8 for h in range(8)]
- a[n - 1][m - 1] = 1
- for i in range(n, 8):
- for j in range(8):
- if 0 < j < 7:
- a[i][j] = a[i - 1][j - 1] + a[i - 1][j + 1]
- elif j:
- a[i][j] = a[i - 1][j - 1]
- else:
- a[i][j] = a[i - 1][j + 1]
- print(sum(a[-1]))
Advertisement
Add Comment
Please, Sign In to add comment