Олимпиадный тренинг

Задача 33142. Knight's move_1


Given a rectangular board N × M (N rows and M columns). In the upper left corner is a chess knight, which must be moved to the lower right corner of the board. In this case, the knight can ONLY move two cells down and one cell to the right, or two cells to the right and one cell down (see picture).
 
 
We need to determine how many different routes there are from the top left to the bottom right corner.
 
Input: the input string contains two natural numbers N and M (\(1 <= N,\ M <= 50\)).  
 
Output: print a single number of ways to get the knight to the bottom right corner of the board.
 
Examples
# Input Output
1 4 4 2