13441344 SUSTech Online Judge
Problem 1344 --[Easy] Simple Sum

1344: [Easy] Simple Sum

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 639  Solved: 245
[Submit][Status][Web Board]

Description

Given \(n\), please calculate \(f(n)\mod (10^9+7)\) where
\[
f(n)=\sum_{i=1}^n i^3
\]

Input

The first line contains an integer \(T (1\leq T\leq 10^3)\), representing the number of test cases.

Then \(T\) lines follow. Each line contains an integer \(n (1\leq n\leq 10^9)\) for a test case.

Output

Output \(T\) lines. Each line contains an integer \(ans\), representing the answer.

Sample Input

3
1
4
100000

Sample Output

1
100
496501211

HINT

Source

 

[Submit][Status]