#P1644. 跳马问题

    ID: 630 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>模拟搜索递推线性递推,递推式

跳马问题

Description

A half Xiangqi (Chinese chess) board is shown in Figure 1. A horse starts from the lower-left corner (0,0)(0,0) and jumps to the upper-right corner (m,n)(m,n). It is only allowed to jump to the right; jumping to the left is not allowed. For example, the route shown in Figure 1 is one valid path. Print the total number of paths.

Input Format

A single line: two integers nn and mm.

Output Format

A single integer: the total number of ways totaltotal.

4 8
37

Hint

For 100%100\% of the testdata: n,m18n, m\leq 18.

Translated by ChatGPT 5