eolymp
bolt
Try our new interface for solving problems
Problems

Knight move

Knight move

The rectangular board of size $n \times m~(n$ rows and $m$ columns) is given. The chess knight is located in the left upper corner. You must relocate it to the right lower corner. The knight can move only either two cells down and one right, or one cell down and two cells right. \includegraphics{https://static.e-olymp.com/content/c2/c214a391722a6e568aaa40a11f19055b8b114e2b.jpg} Find the number of knight paths from the left upper corner to the right lower corner. \InputFile Two positive integers $n$ and $m~(1 \le n, m \le 50)$. \OutputFile Print the number of ways to relocate the knight from the left upper corner to the right lower corner of the board.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 2
Output example #1
1
Input example #2
31 34
Output example #2
293930