#P11770. 檐牙覆雪

    ID: 11178 远端评测题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>数论洛谷原创O2优化洛谷月赛

檐牙覆雪

Description

Still in the familiar place: there are a total of nn window ledges, numbered from top to bottom, with the topmost being numbered 11 and the bottommost being numbered nn. Tianyi notices that the snow accumulations on each ledge can be viewed as a multiset of snowballs, where initially, the first ledge holds a single snowball with a volume of 11, while the other ledges are devoid of any snow. Suddenly, a gust of wind laden with snow blows through, instigating nn transformations in the snow accumulations -

In the ii-th transformation, every snowball on the ii-th ledge is lifted up. Due to peculiar physical phenomena, all ledges whose numbers are multiples of ii (excluding ii itself) receive new snow accumulations. Specifically, let the volume of a lifted snowball be VV. Among these receiving ledges, the one with the largest number receives a snowball of volume V+1V+1, the second largest receives a snowball of volume V+2V+2, and so on. In the end, the lifted snowball mysteriously returns to the ii-th ledge, leaving the snow accumulation on the ii-th ledge unchanged after this transformation.

Ling knows that Tianyi is intrigued by the question: After the nn transformations, what is the total volume of the largest snowball on each ledge? As they sit peacefully admiring the snow, you are tasked with answering this question for them.

Input Format

The first line of the input contains an integer TT — the number of test cases.

The only line of each test case contains an intergers nn — the number of window ledges.

Output Format

For each test case, output a single integer — the total volume of the largest snowball on each ledge.

5
1
5
3
114514
2000000
1
18
6
18057023450
5575638612615

Hint

Sample Explanation

The final state when n=5n=5 is as follows:

On the first ledge is a snowball with a volume of 11;
On the second ledge is a snowball with a volume of 55;
On the third ledge is a snowball with a volume of 44;
On the fourth ledge are two snowballs with volumes of 3,63,6;
On the fifth ledge is a snowball with a volume of 22;

The total volume of the largest snowball on each ledge is 1+5+4+6+2=181+5+4+6+2=18.

Constrains

Subtasks applied. You can only gain the score of the subtask if you accepted all the tests in the subtask.

Subtask ID TT\leq nn\leq Score
1 100100 3×104 3\times10^4 1515
2 100 100 2×106 2\times10^6 3535
3 3×104 3\times10^4 1515
4 2×105 2\times10^5
5 5×105 5\times10^5 2×106 2\times 10^6 2020

For all tests, it is guaranteed that 1T5×1051\le T\le5\times10^51n2×1061\le n\le2\times10^6.