This page is still under construction.

Parts of this page are still being built. What you see may change.

Filling a rectangle with blocks

Time limit1sMemory limit256 MB

Summary
Count the ways to tile an N by M rectangle with rectangles of size k by N for any k, each rotatable, modulo 1999.
Level

Medium7 of 10

Topics
Dynamic programming, Combinatorics, Math
Solved
No attempts yet

Problem

You have an unlimited number of blocks of each size 1×N1 \times N, 2×N2 \times N, …\dots, N×NN \times N. Use them to fill a rectangle of NN rows and MM columns with no gaps.

A block can be turned by 90∘90^\circ. That is, a k×Nk \times N block can be placed as kk rows by NN columns, or as NN rows by kk columns. Blocks must not overlap and must not stick out of the rectangle.

Two fillings count as different if any cell is covered by a block of a different position or shape. Print the number of fillings modulo 19991999.

Input

The first line contains NN and MM, separated by a space. (1≤N≤1001 \le N \le 100, 1≤M≤1041 \le M \le 10^4)

Output

Print the number of fillings modulo 19991999 on one line.

Examples1

  1. Example 1

    Input
    2 12
    
    Expected output
    732