#C11062. Unique Paths in a Grid

    ID: 40337 Type: Default 1000ms 256MiB

Unique Paths in a Grid

Unique Paths in a Grid

Given an m x n grid, find the number of unique paths from the top-left corner to the bottom-right corner. You can only move either down or right at any point.

The number of unique paths can be computed using dynamic programming or by using the combinatorial formula: $$\binom{m+n-2}{m-1}$$. In this problem, you are required to implement a solution that reads the grid dimensions from standard input and outputs the number of unique paths to standard output.

inputFormat

The input consists of a single line containing two space-separated integers m and n, representing the number of rows and columns of the grid respectively.

outputFormat

Output a single integer — the number of unique paths from the top-left corner to the bottom-right corner of the grid.

## sample
3 2
3