409881: GYM103821 M Permutations Score

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

M. Permutations Scoretime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

A permutation of size $$$N$$$ is an array containing distinct values between $$$[1, N]$$$.

Define the score of a permutation $$$P$$$ of size $$$n$$$ as the sum of the number of divisors for every $$$P[i]$$$ that appear strictly before it in the permutation, more formally:

$$$$$$F(P)=\sum_{i=2}^N\sum_{j=1}^{i-1}(P[j] \mid P[i])$$$$$$

For example, the score of permutation $$$\{2,1,3,4\}$$$ is $$$3$$$.

Your task is to find the sum of scores for all permutations of size n.

Since the answer might be very large, output it modulo $$${10}^9+7$$$.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \le T \le 10^5$$$). Description of the test cases follows.

Each of the following $$$T$$$ lines contains a single integer $$$N$$$ ($$$1\le{N}\le{10}^5$$$), the size of the permutations.

Output

For each test case, print in one line the total sum of scores of all permutations in this test case module $$$1\,000\,000\,007$$$.

ExampleInput
3
1
2
3
Output
0
1
6

加入题单

上一题 下一题 算法标签: