#include<bits/stdc++.h>
using namespace std;
int n,k,c,f[100005]={1,2};
int main(){
cin>>n>>k;
if(n==0){
cout<<"0";
}
else if(k==1){
cout<<"1";
}
else{
for(int i=2;i<=n;i++){
for(int j=1;j<=k;j++){
c=i-j;
if(c>=0){
f[i]+=f[i-j];
}
else{
f[i]+=1;
}
}
}
cout<<f[n-1];
}
return 0;
}
求调,k=2的时候一切正常,不等于2就全是错误,加了很多特判,只有20分