A warehouse has n bins numbered 1 to n, each originally holding one item numbered the same as the bin. The items are rearranged into a new permutation p of 1..n, where p(i) is the item now placed in bin i (1-indexed). To keep the reshuffling manageable, every item may move by at most k bins from its original position: |p(i) - i| <= k must hold for every bin i.
Count how many permutations of 1..n satisfy this bounded-displacement condition for the given k.
Input format
Line 1: two integers n and k.
Output format
A single integer: the number of valid permutations.
Constraints
- 1 ≤ n ≤ 8
- 0 ≤ k ≤ n - 1 (when n = 1, k = 0)