#P10979. [2015杭电多校]GCD?LCM!

[2015杭电多校]GCD?LCM!

GCD?LCM!

Problem Description

First we define: (1) lcm(a,b)lcm(a,b), the least common multiple of two integers aa and bb, is the smallest positive integer that is divisible by both aa and bb. for example, lcm(2,3)=6lcm(2,3)=6 and lcm(4,6)=12lcm(4,6)=12. (2) gcd(a,b)gcd(a,b), the greatest common divisor of two integers aa and bb, is the largest positive integer that divides both aa and bb without a remainder, gcd(2,3)=1gcd(2,3)=1 and gcd(4,6)=2gcd(4,6)=2. (3) [exp][exp], expexp is a logical expression, if the result of expexp is truetrue, then [exp]=1[exp]=1, else [exp]=0[exp]=0. for example, [1+23]=1[1+2\geq 3]=1 and [1+24]=0[1+2\geq 4]=0. Now Stilwell wants to calculate such a problem:

$$F(n)=\sum_{i=1}^n\sum_{j=1}^n~[~lcm(i,j)+gcd(i,j)\geq n~] \\ S(n)=\sum_{i=1}^nF(i)$$

Find S(n) mod 258280327S(n)~mod~258280327.

Input

The first line of the input contains a single number TT, the number of test cases. Next TT lines, each line contains a positive integer nn. T105T\leq 10^5, n106n\leq 10^6.

Output

TT lines, find S(n) mod 258280327S(n)~mod~258280327.

Sample Input

8
1
2
3
4
10
100
233
11037

Sample Output

1
5
13
26
289
296582
3928449
213582482

Author

SXYZ

Source

2015 Multi-University Training Contest 8