KOPC12B - K12-Combinations

Given n find the value of ((nC1)2+2*(nC2)2+3*(nC3)2+4*(nC4)2+ ... +n*(nCn)2)% MOD, where MOD=10^9+7.

Note: nCr is the number of ways of choosing r items from n items.

Input

The first line of input file contains T which denotes number of test cases. Each of the following line contains an integer n. T<=1000 and n<=10^6.

Output

The output must contain T lines each line corresponding to a testcase.

Example

Input:
2
1
2

Output:
1
6

Added by:Radhakrishnan Venkataramani
Date:2012-01-31
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2014-10-24 19:45:30 mandu_ism
Beware of unnecessary precomputations! cost me a lot of TLEs.
2013-06-05 09:25:47 vikas sharma
Finally AC.... was doing a silly mistake...:)
2013-05-14 18:30:11 [Lakshman]
Good one...Finally AC....
2013-05-12 03:41:15 Ouditchya Sinha
Finally AC! Awesome problem. High School Maths... :)
2013-04-20 20:25:30 Arpit Mittal
strangely getting nzec error
2012-02-07 18:43:14 varshini
getting TLE..!!!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.