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
madhur4127:
20170925 07:49:52
3 liner in python3! 

shubham0028:
20170914 20:17:50
in my case it is showing wrong answer but in ideone its giving the correct output


mssr_code:
20170906 00:12:34
for c/c++ use long long for "n","answer" for sure 

prasanth292130:
20170905 15:54:55
AC in a go................ 

nitisha1:
20170905 05:57:57
AC in 1 go................... 

kholan:
20170828 02:30:52
@vishal3410 be careful to initiallize your variables on the stack properly with c based languages especially N and T in your case, no need to treat two separate cases here


raichu7:
20170819 23:48:44
AC in one go :) 

vishal3410:
20170715 22:52:56
what's wrong with my code it shows runtime error, http://ideone.com/V5SYAy 

vish_14:
20170616 13:43:34
Didn't read the question carefully & got WA because of modulus.


sandeep_4141:
20170615 21:24:05
try to use pen and copy !! it's take less than 5 minute to evaluate problem and drive direct formula !!

Added by:  Paulo Costa 
Date:  20120130 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  UGTO 