eolymp
bolt
Try our new interface for solving problems
Problems

Lemon Tale

Lemon Tale

For each programmer a point comes when the last contest is lost, and it is time to retire. Even Three Programmers themselves could not escape the common lot. But the Programmers also wanted to keep a good memory about themselves. For this noble purpose they created problems and organized extremely popular programming contests from time to time. Of course, this work was not well paid, but for true programmers a glory was more important than money. However it is only the first half of a job to think out a brilliant problem. The second one is to create a politically correct statement for it. The matter is the statement of some problem for the upcoming contest was written by the Third Programmer, who knew nothing about political correctness. He just wrote a story about citrus plants growing. As a result a word "lemon" was mentioned \textbf{N} times in the statement. Besides, the problem is to be looked through by famous censor Alexander K. right before the contest. And it is a known fact, that lemons remind him of oranges he hates furiously. It worries the First and the Second Programmers greatly - they know exactly, that if a word "lemon" occurs more than \textbf{K} times successively, the problem will be immediately disqualified from the contest. That is why the First and the Second Programmers connived secretly to login to the server at the eve of the contest and replace some "lemons" with much more politically correct "bananas" so that the problem could not be disqualified. How many ways are there to do it? \InputFile The only line contains the integer numbers \textbf{N} (1 ≤ \textbf{N} ≤ 10000) and \textbf{K} (0 ≤ \textbf{K} ≤ \textbf{N}). \OutputFile You should output the desired number of ways. \textit{\textbf{Hint}}: Let us denote a word "lemon" by a letter "\textbf{L}" and a word "banana" by a letter "\textbf{B}". So in the sample the initial sequence of words "\textbf{LLLLL}" might be transformed into the following politically correct sequences: "\textbf{LLBLL}", "\textbf{LLBLB}", "\textbf{LLBBL}", "\textbf{LLBBB}", "\textbf{LBLLB}", "\textbf{LBLBL}", "\textbf{LBLBB}", "\textbf{LBBLL}", "\textbf{LBBLB}", "\textbf{LBBBL}", "\textbf{LBBBB}", "\textbf{BLLBL}", "\textbf{BLLBB}", "\textbf{BLBLL}", "\textbf{BLBLB}", "\textbf{BLBBL}", "\textbf{BLBBB}", "\textbf{BBLLB}", "\textbf{BBLBL}", "\textbf{BBLBB}", "\textbf{BBBLL}", "\textbf{BBBLB}", "\textbf{BBBBL}" and "\textbf{BBBBB}".
Time limit 1 second
Memory limit 64 MiB
Input example #1
5 2
Output example #1
24
Author N.Rybak, I.Grebnov, D.Kovalioff