Klocki

No attempts yetTime limit1sMemory limit128 MB

Problem

Bajtazar loves rearranging kk identical blocks among nn drawers numbered 1,2,,n1, 2, \dots, n. Each drawer holds at most one block, and at every moment exactly kk of the drawers contain a block, so an arrangement can be written as a string of nn digits from {0,1}\{0, 1\} with exactly kk ones: the ii-th digit is 11 when drawer ii holds a block and 00 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:

  • every arrangement after the first is obtained from the previous one by a single step,
  • the first and the last arrangement are identical (his starting arrangement), and
  • no other arrangement repeats.

His starting arrangement has the kk blocks in the first kk drawers (the string with kk ones followed by nkn - 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).

Input

A single line with two integers nn and kk (1n311 \le n \le 31, 1kn1 \le k \le n).

Output

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=4n = 4 and k=2k = 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 77.