#K47692. Unique Paths in a Grid

    ID: 28255 Type: Default 1000ms 256MiB

Unique Paths in a Grid

Unique Paths in a Grid

You are given an m x n grid.

You start at the top-left corner and your goal is to reach the bottom-right corner. In each step, you may move either down or right.

The total number of unique paths can be computed using dynamic programming or via the combinatorial formula \( \text{paths} = \binom{m+n-2}{m-1} \).

Your task is to calculate the number of unique paths for the given grid dimensions.

inputFormat

The input is provided via stdin and consists of two space-separated integers:

  • m - the number of rows.
  • n - the number of columns.

outputFormat

Output the number of unique paths from the top-left corner to the bottom-right corner via stdout.

## sample
3 2
3

</p>