B. Having Fun

1

1 votes
Easy, Math
Problem

Jack loves number series. One day he found a series

1,4,11,24,45,76,119...

ans wants to find the sum of first n terms.

Since he got stuck in finding the sum so he wants your help.

Help him to find the sum of first n terms.

Since the sum may be large so take modulo with 109+7

Input

First line contain number of test cases t.

Next t lines contains a number n.

Output

Print a single number denoting the sum of first n terms modulo109+7

Constraints

1<=t<=105

1<=n<=106

 

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

for n=5,

sum=1+4+11+24+45=85

Editor Image

?