P1644 Horse Jump Problem

Description

A half Xiangqi (Chinese chess) board is shown in Figure 1. A horse starts from the lower-left corner $(0,0)$ and jumps to the upper-right corner $(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. ![](https://cdn.luogu.com.cn/upload/image_hosting/8gkasdvs.png)

Input Format

A single line: two integers $n$ and $m$.

Output Format

A single integer: the total number of ways $total$.

Explanation/Hint

For $100\%$ of the testdata: $n, m\leq 18$. Translated by ChatGPT 5