401843: GYM100541 B Sum
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
B. Sumtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
Write a program to compute the following sum S given a positive integer n:
, where is the largest integer not greater than x.
InputThe input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 30. The following lines describe the datasets.
Each dataset contains a positive integer n (n ≤ 1012) written on a separate line.
OutputFor each dataset, write in one line the remainder of the computed sum S divided by 106.
ExamplesInput2Output
1
5
1
10