#P6222. 「P6156 简单题」加强版
「P6156 简单题」加强版
Description
There are queries. At the beginning, you are given a constant . In each query, you are given separately. Please compute:
$$\sum_{i=1}^{n}\sum_{j=1}^{n} (i+j)^K \gcd(i,j) \mu^2(\gcd(i,j)) \pmod {2^{32}}$$Input Format
The first line contains three positive integers , representing the number of queries, the maximum value of among the queries, and the given constant.
In the next lines, each line contains one positive integer, representing the value of for that query.
Output Format
Output lines. Each line contains one non-negative integer, representing the result of evaluating the expression in the statement for the given .
4 1919 5
1
14
51
4
32
1012884514
62017882
105160
Hint
There are groups of testdata. Group satisfies: .
For all testdata, it holds that: , .
Translated by ChatGPT 5
京公网安备 11011102002149号