## TSSPC '20 Contest 1 P5 - Trick or Trail

View as PDF

Points: 17 (partial)
Time limit: 3.0s
Memory limit: 250M

Authors:
Problem type

It's Halloween and Henry_Zhang loves candy, but is too scared to go trick or treating (he's very afraid). He lives in a terrifying grid neighbourhood of dimension x . sankeeth_ganeswaran lives at and he wants to deliver candy to Henry_Zhang who lives at . sankeeth_ganeswaran rides his old haunted broomstick but accidentally trips and squishes it, breaking it under all his weight! His broken broom can only fly him up or right on the grid. How many spooky paths can he take to get there? As the answer can be hauntingly large, find the answer modulo .

#### Input Specification

The first line contains two space-seperated integers

#### Output Specification

Output the amount of paths.

#### Sample Input 1

1 2

#### Sample Output 1

3

#### Explanation for Output 1

The following image depicts the 3 paths that he can take

#### Sample Input 2

30 70

#### Sample Output 2

511931791

#### Explanation for Output 2

There are paths, which is equivalent to