TSSPC Contest 1 P5 - Trick or Trail
View as PDFIt's Halloween and 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
. lives at
and he wants to deliver candy to who lives at
. 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.
Subtasks
Subtask 1 [5%]
Subtask 2 [15%]
Subtask 3 [80%]
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
Comments