atcoder#ABC208F. [ABC208F] Cumulative Sum
[ABC208F] Cumulative Sum
Score : points
Problem Statement
For non-negative integers and , let us define the function as follows, using a positive integer .
$\displaystyle f(n, m) = \begin{cases} 0 & (n = 0) \\ n^K & (n \gt 0, m = 0) \\ f(n-1, m) + f(n, m-1) & (n \gt 0, m \gt 0) \end{cases}$
Given , , and , find modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print modulo .
3 4 2
35
When , the values for are as follows.
0 1 2
0
1000000000000000000 30 123456
297085514