SuperClimber
This time Little Draganče started practicing free climbing. The wall he is practicing on is N + 1 squares tall and 2*K+1 squares wide. The bottom left square is at (-K, 0) and the top right is at (K, N)
Little Draganče starts from the block (0,0). At each step Little Draganče climbs one block and either moves left one block, right one block or stays in the same line of climbing. So from (a, b), Little Draganče can go to (a-1, b+1), (a, b+1) and (a+1, b+1), as long as the destination square exists.
The question is: In how many ways can Little Draganče climb to the top level.
InputThe first line of the standard input will contain two numbers N and K. 1 \leq N \leq 10^{18}; 0 \leq K \leq 25.
OutputTo one line of the standard output write one integer representing the number of ways Little Draganče can climb to the top level (N-th level) modulo 321555123
Input:
Output:
6 9Output:
729Input:
Output:
12 9Output:
531233Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.