#P10895. 选择困难症
选择困难症
Background
Parviz believes that if a problem has a method that can significantly optimize the complexity but you do not use it, then the problem is “regretful”.
Alice believes that any problem whose algorithmic difficulty is greater than the difficulty of thinking is meaningless in an official contest.
Cat-cat believes that they are studying mathematics.
believes... Huh? What are you talking about?
What is very funny is that you might not be able to match these four names to the right people right away.
Problem Description
Besides playing chess, Alice and Bob also need some entertainment activities to relax, such as going to the snack street to eat. As a gentleman, Bob lets Alice choose which restaurant to eat at every time. This makes Alice troubled—she has indecisiveness.
There are restaurants on the snack street. Eating at the -th restaurant costs yuan. If the budget is yuan, then one can choose among the first restaurants.
After a long time of hesitation, Alice comes up with a method: she decides in advance a non-negative integer . After learning the budget , she chooses to eat at the -th restaurant.
Because the market price of chessboards and pieces fluctuates, the budget for each meal may not be the same, but it is always an integer in . Alice wants to change her taste each time, and hopes that for different , the final chosen restaurants are all different. She wants to know the number of that satisfy the requirement, but she is busy playing chess with Bob and has no time to compute it, so she asks you for help.
Formally, for a given , you need to find how many integers satisfy that are all distinct. Output the answer modulo .
Input Format
The first line contains an integer , indicating that there are test cases.
The next lines each contain an integer , whose meaning is given in the statement.
Output Format
Output lines. Each line contains an integer representing the number of that satisfy the requirement.
3
3
4
5
4
3
6
5
13860108
13850709
220000633
693439571
1004535809
188051653
724253523
444803502
370347248
425186012
Hint
Sample Explanation 1
When , the sets of possible values of are and , respectively.
When :
. You can verify that there is no other in that satisfies the condition, so the answer is .
| Test Point ID | ||
|---|---|---|
For of the testdata, and .
Translated by ChatGPT 5