CRDS  Cards
Maricruz have a lot of cards, she always uses her cards to build pyramids as shown in the following image:
A pyramid card of 3 levels. She always wonder how many cards does she need to make a pyramid card of N levels. Your task is to answer that question.
Input
The first line of the input contains an integer 1 <= T <= 1,000. Each of the following T lines will have an integer 1 <= N <= 1,000,000.
Output
For each case, output a single line consisting of the number of cards needed to build a pyramid card of level N modulo 1,000,007.
Example
Input Example 2 3 7 Output Example 15 77
hide comments
phoenix0o0:
20181226 19:06:56
It is not sum(n%1000007) it is sum(n)%1000007.


adipat:
20181013 09:34:28
Need to use long long for C/C++ otherwise when calculating the number of cards there will be an overflow. 

rohitjain00:
20181012 16:41:47
Use input as long in java, using int got me two Wrong Answers 

Yauhen:
20180921 14:08:54
weird modulo. 

pranjal1_:
20180818 12:09:56
getting wrong answer after taking modulo


koustubh:
20180708 09:19:57
PAY attention! You have to give number of cards modulo 1000007 as answer 

wrzoboo:
20180704 17:44:22
OEIS.ORG is very useful for problems like this one ;) 

vivek_dwivedi:
20180615 04:48:36
spoj toolkit totaly gives wrong output.. for larger value.. wasted half an hour on solving shit!! Ac in 1 ;)


navidator:
20180526 01:24:16
Be aware of that mod 1000007. 

nightwayne:
20180505 13:00:01
Can anyone help me figure out why it is giving WA when I take N as 'int' but AC when I take it as 'long long int' ? Range of N here is given till 10^6, well under the limit of 'int' ? 
Added by:  Paulo Costa 
Date:  20120130 
Time limit:  0.449s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  UGTO 