# n酒店,m花 n, m = map(int, input().split()) dp = [[[0for k inrange(m + 1)] for j inrange(m + 1)] for i inrange(n + 1)] # dp[i][j][k] 遇到i个酒店j个花后剩余k酒量的方案数 dp[0][0][2] = 1 # dp[1][0][4] = 1 # dp[0][1][1] = 1 # dp[0][2][0] = 1
for i inrange(0, n + 1): for j inrange(0, m + 1): for k inrange(m + 1): if j == m and i != n: # 不能没花了但酒店还有 continue ifnot k & 1and i > 0: # 现在这一个是酒店,i减1,k是一半 dp[i][j][k] += dp[i - 1][j][k // 2] if k != m and j > 0: dp[i][j][k] += dp[i][j - 1][k + 1]