#P6042. 「ACOI2020」学园祭
「ACOI2020」学园祭
Description
To take advantage of this rich-but-foolish young master and increase his spending as much as possible, Rio tried hard to hint at Nagisa. With no other choice, Nagisa thought for a while and raised a question:
Given an , define:
Compute:
$$\sum_{i=1}^n \sum_{j=1}^i \sum_{k=1}^j \gcd(A_{i-j}^j \times \Gamma(j),A_{j-k}^k \times \Gamma(k))$$Nagisa read out the words written on the conversation board Rio held up: If you cannot answer the question within the given time, you have to buy the entire menu once!
Although Yuji has a lot of money, he does not want to eat too much, because this problem has subproblems.
Since the answer may be very large, output the answer modulo .
Input Format
This problem contains multiple test cases.
The first line contains an integer , the number of test cases.
For each test case:
There is only one line with one integer .
Output Format
For each test case, output one integer per line: the answer modulo .
5
1
2
3
4
5
1
4
10
20
36
Hint
Constraints
This problem uses bundled testdata.
- Subtask 1 (20 points): , .
- Subtask 2 (30 points): , .
- Subtask 3 (50 points): , .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号