luogu#P1644. 跳马问题

跳马问题

Problem 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