#P3990. [SHOI2013] 超级跳马
[SHOI2013] 超级跳马
Description
Given an -row by -column board, a knight wants to jump from the top-left corner to the bottom-right corner. At each step, it jumps to the right by an odd number of columns and lands in the same row or an adjacent row. During the jump, the knight must not leave the board. For example, when , , the figure below shows a valid sequence of jumps.

Find the number of different jump sequences modulo .
Input Format
A single line containing two positive integers , , representing the size of the board.
Output Format
Output a single line containing one integer, the number of jump sequences modulo .
3 5
10
Hint
- For of the testdata, , .
- For of the testdata, , .
- For of the testdata, , .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号