#P6189. [NOI Online #1 入门组] 跑步
[NOI Online #1 入门组] 跑步
Problem Description
Little H is a child who loves sports. One day, he wants to make a running plan for himself. Little H plans to run meters in total. In the -th minute (), he will run meters ( is a positive integer), but the total duration is not fixed.
As the running time increases, Little H will get more and more tired, so his plan must satisfy that for any (), .
Now Little H wants to know how many different plans satisfy the conditions. Two plans are different if and only if the total duration is different, or there exists an such that is different in the two plans.
Since the final answer may be very large, you only need to output the result modulo .
Input Format
The input contains only one line with two integers, representing the total meters and the modulus .
Output Format
Output one line with one integer, representing the answer modulo .
4 44
5
66 666666
323522
66666 66666666
45183149
Hint
Explanation of Sample Input/Output 1
The five different plans are: , , , , .
Constraints
This problem has test points. The information for each test point is shown in the table below.
| Test Point ID | Test Point ID | ||
|---|---|---|---|
For all test points, it is guaranteed that , .
Translated by ChatGPT 5