#K14236. Distinct Paths in a Grid

    ID: 24090 Type: Default 1000ms 256MiB

Distinct Paths in a Grid

Distinct Paths in a Grid

Given an n x n grid, find the number of distinct paths from the top-left corner to the bottom-right corner by moving only to the right or down. This problem can be viewed as computing the binomial coefficient:

$$\binom{2n-2}{n-1} = \frac{(2n-2)!}{((n-1)!)^2}$$

where n is an integer such that 1 ≤ n ≤ 100.

inputFormat

The input consists of a single integer n representing the dimensions of the grid.

outputFormat

Output a single integer which is the number of distinct paths from the top-left corner to the bottom-right corner in the grid.

## sample
1
1