#Q229. 「一本通 6.6 例 2」2^k 进制数

「一本通 6.6 例 2」2^k 进制数

Description

Original source: NOIP 2006 Senior Division

Let rr be a 2k2^k-based number that satisfies the following conditions:

  • rr must be at least a 2-digit number in base 2k2^k.
  • As a 2k2^k-based number, every digit of rr (except the last one) is strictly less than the digit immediately to its right.
  • After converting rr to a binary number qq, the total number of bits in qq does not exceed ww.

Here, the positive integers kk and ww are given in advance.

Question: How many distinct rr satisfy the above conditions?

Input Format

The input consists of a single line with two positive integers kk and ww.

Output Format

The output is a single line containing a positive integer, which is the result of the calculation—the number of distinct rr that satisfy the conditions (expressed in decimal, with the highest digit not being zero and no additional characters such as spaces, line breaks, or commas inserted between digits).

Note: The resulting positive integer may be very large but will not exceed 200 digits.

Sample 1

3 7

36

Data Range and Hint

For all data, 1k9,k<w3×1041\le k\le 9,k\lt w\le 3\times 10^4.