atcoder#ABC253E. [ABC253E] Distance Sequence
[ABC253E] Distance Sequence
Score : points
Problem Statement
How many integer sequences of length satisfy all the conditions below?
Since the count can be enormous, find it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the count modulo .
2 3 1
6
The following sequences satisfy the conditions.
3 3 2
2
The following sequences satisfy the conditions.
100 1000 500
657064711
Print the count modulo .