题目链接

题意:


题解:














AC代码
初学python,上一手拙劣代码

n, d = map(int,input().split())
f=[0 for i in range(140)]
f[1]=1
for i in range(2, n+1):
    f[i] = 1 + f[i - 1] + f[i - d - 1]
print((1 << n - 1) - 1 - f[n - d - 1])