luogu#P5174. 圆点
圆点
Background
The senior high school entrance exam is here. Pg stared at the last (hardest) problem on the math paper and fell into deep thought……
Solution: https://blog.csdn.net/kkkksc03/article/details/85008125
Problem Description
As everyone knows, every lattice point (integer-coordinate point) on the plane is passed through by exactly one circle centered at the origin. We define the weight of this lattice point as the square of the radius of the circle that passes through it.
Now there is a circle centered at the origin with radius . You need to find the sum of the weights of all lattice points contained in this circle.
Since the answer may be very large, output it modulo .
Input Format
One number .
Output Format
One line with only one number.
3
12
100
16012
1234567
205275050
Hint
Explanation for Sample 1:
There are lattice points in total: $(0,0),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1),(-1,0),(-1,1)$.
Their weights are , and the total sum is 12.
Constraints:
For of the testdata,
For of the testdata,
Translated by ChatGPT 5