LogiQuest

220. Grid Paths

EasyCombinatoricsRecursion

Count the paths from the top-left to the bottom-right of an r×c grid moving only right or down.

Input format

A single line: r c

Output format

The number of paths.

Example 1

Input

3 3

Output

6

Example 2

Input

1 1

Output

1

Constraints

1 ≤ r, c ≤ 30

Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.

Loading the MyLoginn IDE…