n,m,k,i,j:longint;
f:array[0..1000000]of longint;
begin
read(n,m);
f[0]:=1;
for i:=1 to n do
if i<m then f[i]:=2*f[i-1];
if i=m then f[i]:=2*f[i-1]-1;
if i>m then f[i]:=2*f[i-1]-f[i-m-1];
end;
write(f[n]);
end.
快速帮助 | 运行状态 | 反馈举报 | 关于我们 | 免责声明 | 浙ICP备11060257号 Processed in 0.0030 Second(s) Copyright (C) RQNOJ 2007-2019. All Rights Reserved.