CF1731B.Kill Demodogs

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Kill Demodogs

Demodogs from the Upside-down have attacked Hawkins again. El wants to reach Mike and also kill as many Demodogs in the way as possible.

Hawkins can be represented as an n×nn \times n grid. The number of Demodogs in a cell at the ii-th row and the jj-th column is iji \cdot j. El is at position (1,1)(1, 1) of the grid, and she has to reach (n,n)(n, n) where she can find Mike.

The only directions she can move are the right (from (i,j)(i, j) to (i,j+1)(i, j + 1)) and the down (from (i,j)(i, j) to (i+1,j)(i + 1, j)). She can't go out of the grid, as there are doors to the Upside-down at the boundaries.

Calculate the maximum possible number of Demodogs ans\mathrm{ans} she can kill on the way, considering that she kills all Demodogs in cells she visits (including starting and finishing cells).

Print 2022ans2022 \cdot \mathrm{ans} modulo 109+710^9 + 7. Modulo 109+710^9 + 7 because the result can be too large and multiplied by 20222022 because we are never gonna see it again!

(Note, you firstly multiply by 20222022 and only after that take the remainder.)

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \leq t \leq 10^4). Description of the test cases follows.

The first line of each test case contains one integer nn (2n1092 \leq n \leq 10^9) — the size of the grid.

Output

For each test case, print a single integer — the maximum number of Demodogs that can be killed multiplied by 20222022, modulo 109+710^9 + 7.

Note

In the first test case, for any path chosen by her the number of Demodogs to be killed would be 77, so the answer would be 20227=141542022 \cdot 7 = 14154.

Samples

4
2
3
50
1000000000
14154
44484
171010650
999589541

在线编程 IDE

建议全屏模式获得最佳体验