題目來源:judgegirl from ntu prof. pangfeng Liu
Task Description
Write a program to compute the number of ways to go from the lower left corner of a matrix to upper right corner. The matrix has rows and columns. You can only move one cell to another cell, and only to the right or to the top. Please compute the number of ways you can go. Note that you are strongly encouraged to think in "recursion" to solve this problem.
編寫一個程式來計算從矩陣的左下角到右上角的路徑數。該矩陣有 r 行和 c 列。您只能將一個單元格移動到另一個單元格,並且只能往右移和往上移。請計算你可以走的路數。請注意,強烈建議您以“遞迴”的方式思考來解決此問題。Limits
Both and are no more than .
r 和 c 均不超過 12。Input Format
There are one line in the input. The first line has and .
輸入中只有一行。第一行有 r 和 c。Output Format
There are one lines in the output. The first line has the number of ways as in the description.
輸出中只有一行。第一行有描述中的方法數。Sample Input
4 3
Sample Output
10