map int input split for in range for in range for in range i-2 j-1 i-1

1
2
3
4
5
6
7
p,m= map(int,input().split())
k = [[0]*(m+1) for i in range(p+1)]
k[1][1]=1
for i in range (2, p+1):
for j in range (2, m+1):
k[i][j] = k[i-2][j-1] + k[i-1][j-2]
print(k[p][m])