atcoder#ABC262H. [ABC262Ex] Max Limited Sequence
[ABC262Ex] Max Limited Sequence
Score : points
Problem Statement
Find the number, modulo , of integer sequences of length that satisfy all of the following conditions:
- for all such that .
- The maximum value of is for all such that .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 3 2
1 2 2
2 3 3
5
$A = (0, 2, 3), (1, 2, 3), (2, 0, 3), (2, 1, 3), (2, 2, 3)$ satisfy the conditions.
1 1 1
1 1 1
1
6 40000000 3
1 4 30000000
2 6 20000000
3 5 10000000
135282163