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.

Input

The 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.

Output

For each dataset, write in one line the remainder of the computed sum S divided by 106.

ExamplesInput
2
1
5
Output
1
10

加入题单

算法标签: