SP11560 PUCMM210 - A Summatory

Background

### 题意翻译: 定义$f(n)=\sum\limits_{i=1}^ni^3$ 你需要求出$\sum\limits_{i=1}^nf(i)$ 将答案对$1000000003$取模。 ### 输入格式: 一行一个正整数$T$,接下来$T$行,每行一个正整数$n$ ### 输出格式: $T$行,每行一个正整数表示答案

Description

f(n) is defined as: f(n) = 1 $ ^{3} $ +2 $ ^{3} $ +3 $ ^{3} $ +...+n $ ^{3} $ , so it is the sum of the cubes of all natural numbers up to n. In this problem you are about to compute, f(1) + f(2) + f(3) + ... + f(n)

Input Format

The first line is an integer **T**(1 T T test cases follow. For each test case, there is an integer **n**(1 n

Output Format

For each test case output the result of the summatory function described above. Since this number could be very large, output the answer modulo 1,000,000,003.