#aising2020f. [aising2020_f]Two Snuke

[aising2020_f]Two Snuke

Problem Statement

Given is an integer NN. Snuke will choose integers s1s_1, s2s_2, n1n_1, n2n_2, u1u_1, u2u_2, k1k_1, k2k_2, e1e_1, and e2e_2 so that all of the following six conditions will be satisfied:

  • 0leqs1<s20 \\leq s_1 < s_2
  • 0leqn1<n20 \\leq n_1 < n_2
  • 0lequ1<u20 \\leq u_1 < u_2
  • 0leqk1<k20 \\leq k_1 < k_2
  • 0leqe1<e20 \\leq e_1 < e_2
  • $s_1 + s_2 + n_1 + n_2 + u_1 + u_2 + k_1 + k_2 + e_1 + e_2 \\leq N$

For every possible choice (s1,s2,n1,n2,u1,u2,k1,k2,e1,e2)(s_1,s_2,n_1,n_2,u_1,u_2,k_1,k_2,e_1,e_2), compute $(s_2 − s_1)(n_2 − n_1)(u_2 − u_1)(k_2 - k_1)(e_2 - e_1)$, and find the sum of all computed values, modulo (109+7)(10^{9} +7).

Solve this problem for each of the TT test cases given.

Constraints

  • All values in input are integers.
  • 1leqTleq1001 \\leq T \\leq 100
  • 1leqNleq1091 \\leq N \\leq 10^{9}

Input

Input is given from Standard Input in the following format:

TT mathrmcase1\\mathrm{case}_1 vdots\\vdots mathrmcaseT\\mathrm{case}_T

Each case is given in the following format:

NN

Output

Print TT lines. The ii-th line should contain the answer to the ii-th test case.


Sample Input 1

4
4
6
10
1000000000

Sample Output 1

0
11
4598
257255556
  • When N=4N=4, there is no possible choice (s1,s2,n1,n2,u1,u2,k1,k2,e1,e2)(s_1,s_2,n_1,n_2,u_1,u_2,k_1,k_2,e_1,e_2). Thus, the answer is 00.
  • When N=6N=6, there are six possible choices (s1,s2,n1,n2,u1,u2,k1,k2,e1,e2)(s_1,s_2,n_1,n_2,u_1,u_2,k_1,k_2,e_1,e_2) as follows:
    • (0,1,0,1,0,1,0,1,0,1)(0,1,0,1,0,1,0,1,0,1)
    • (0,2,0,1,0,1,0,1,0,1)(0,2,0,1,0,1,0,1,0,1)
    • (0,1,0,2,0,1,0,1,0,1)(0,1,0,2,0,1,0,1,0,1)
    • (0,1,0,1,0,2,0,1,0,1)(0,1,0,1,0,2,0,1,0,1)
    • (0,1,0,1,0,1,0,2,0,1)(0,1,0,1,0,1,0,2,0,1)
    • (0,1,0,1,0,1,0,1,0,2)(0,1,0,1,0,1,0,1,0,2)
  • We have one choice where $(s_2 − s_1)(n_2 − n_1)(u_2 − u_1)(k_2 - k_1)(e_2 - e_1)$ is 11 and five choices where $(s_2 − s_1)(n_2 − n_1)(u_2 − u_1)(k_2 - k_1)(e_2 - e_1)$ is 22, so the answer is 1111.
  • Be sure to find the sum modulo (109+7)(10^{9} +7).