#P17436. 「LWLV Round 1」Jump!

「LWLV Round 1」Jump!

Background

Little L really loves to jump, but this also makes him get faked out and knocked away in basketball games.

Problem Description

Little L has a sequence aa of length nn, where all elements are within [1,n][1,n].

Little L has a variable xx, initially x=1x=1.

Then Little L will perform the jump operation on the variable several times until no more operations can be performed. Specifically, if 1≤x≤n1\le x\le n, then xx increases by axa_x.

Due to the nature of the jump operation, in the end we will have n<x≤2×nn< x\le 2\times n. He wants to know how many sequences aa make x=n+1x=n+1 after performing the jump operation several times.

Since the answer may be very large, output the result modulo 109+710^9+7.

Input Format

This problem has multiple test cases.

The first line contains a positive integer TT, denoting the number of test cases.

Then there are TT test cases. For each test case, one line contains a positive integer nn.

Output Format

For each test case, output the answer modulo 109+710^9+7.

3
2
20
1145141919810
3
292439931
825800492

Hint

Sample Explanation

When n=2n=2, there are the following 33 sequences aa that satisfy the requirement:

[1,1][1,1] [2,1][2,1] [2,2][2,2]

Constraints

Subtask ID T≤T\le n≤n\le Score
00 88 55
11 55 10001000 2020
22 10510^5 2525
33 5×1045\times 10^4 101810^{18} 5050

For 100%100\% of the testdata, it is guaranteed that T≤5×104T\le 5\times 10^4 and n≤1018n\le 10^{18}.

Translated by ChatGPT 5