QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB مجموع النقاط: 100

#7824. Frog

الإحصائيات

There are $N$ water lilies growing in a line, 1 meter apart from each other, numbered from 1 to $N$. A frog is sitting on lily number 1. In one move, the frog can jump forward or backward to any lily at a distance of no more than $K$ meters. When the frog jumps off a lily, that lily closes and sinks, and it can no longer be jumped on. How many ways are there for the frog to move to lily number $N$?

Input

A single line containing two space-separated integers $N$ and $K$, where $N$ is the number of lilies, $2 \le N \le 18$, and $K$ is the maximum jump distance, $1 \le K < N$.

Output

A single positive integer — the number of ways the frog can move from lily 1 to lily $N$ according to the rules.

Examples

Input 1

3 2

Output 1

2

Input 2

4 2

Output 2

4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.