#K95027. Unique Paths in a Grid

    ID: 38772 Type: Default 1000ms 256MiB

Unique Paths in a Grid

Unique Paths in a Grid

You are given two positive integers m and n representing the number of rows and columns in a grid.

Your task is to calculate the number of unique paths from the top-left corner to the bottom-right corner of the grid. You can only move either down or right at any point in time.

This problem can also be solved using the combinatorial formula: \[ \binom{m+n-2}{m-1} \] where \(\binom{n}{k}\) is the binomial coefficient.

Note: The solution must read input from stdin and write the result to stdout.

inputFormat

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

outputFormat

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

## sample
3 2
3