#K75132. Unique Paths in a Grid
Unique Paths in a Grid
Unique Paths in a Grid
You are given a grid with N rows and M columns. Starting from the top-left cell, your goal is to reach the bottom-right cell. From any cell, you can only move either to the right or downward. The total number of unique paths is given by the formula:
$$\binom{N+M-2}{N-1}$$
Your task is to compute and output the number of unique paths from the top-left corner to the bottom-right corner of the grid.
inputFormat
The input consists of a single line containing two space-separated integers N and M, where 1 ≤ N, M ≤ 100.
outputFormat
Output a single integer: the number of unique paths from the top-left corner to the bottom-right corner of the grid.
## sample2 2
2
</p>