atcoder#AGC041D. [AGC041D] Problem Scores
[AGC041D] Problem Scores
Score : points
Problem Statement
problems have been chosen by the judges, now it's time to assign scores to them!
Problem must get an integer score between and , inclusive. The problems have already been sorted by difficulty: must hold. Different problems can have the same score, though.
Being an ICPC fan, you want contestants who solve more problems to be ranked higher. That's why, for any (), you want the sum of scores of any problems to be strictly less than the sum of scores of any problems.
How many ways to assign scores do you have? Find this number modulo the given prime .
Constraints
- is a prime.
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of ways to assign scores to the problems, modulo .
2 998244353
3
The possible assignments are , , .
3 998244353
7
The possible assignments are , , , , , , .
6 966666661
66
96 925309799
83779