Bajtazar loves rearranging k identical blocks among n drawers numbered 1,2,…,n. Each drawer holds at most one block, and at every moment exactly k of the drawers contain a block, so an arrangement can be written as a string of n digits from {0,1} with exactly k ones: the i-th digit is 1 when drawer i holds a block and 0 otherwise.
A single step consists of taking one block out of some drawer and putting it into a different, empty drawer, which always changes the arrangement.
His friend Bajtolina is watching, but she loses interest the instant she sees an arrangement that has already appeared. To keep her entertained as long as possible, Bajtazar wants the longest possible sequence of arrangements such that:
His starting arrangement has the k blocks in the first k drawers (the string with k ones followed by n−k zeros).
Determine the length of the longest such sequence, that is, how many arrangements it lists (the starting arrangement is counted once at the beginning and once again at the end).
A single line with two integers n and k (1≤n≤31, 1≤k≤n).
Print one integer: the length of the longest sequence of arrangements described above, counting the starting arrangement both at the beginning and at the end.
For instance, when n=4 and k=2 there are six different ways to place two blocks in four drawers, and the longest sequence passes through all six and then returns to the starting arrangement, so its length is 7.