PUCMM210 - A Summatory

题意翻译

## 题意描述 f(n)的定义为:f(n)=1^3+2^3+3^3+…+n^3,所以它是所有自然数到n的立方的和。 在这个问题中,你要计算,f(1) + f(2) + f(3) +…+ f (n) ## 输入输出格式 ### 输入格式 第一行是一个整数T(1≤T≤100000),表示测试用例的数量。接下来是T个测试用例。对于每个测试用例,都有一个整数n (1≤n≤1000000),写在一行。 ### 输出格式 对于每个测试用例,输出上述算式的结果。 由于这个数字可能非常大,因此输出答案模1 000,000,003。 ## 输入输出样例 ### 输入样例#1: 3 2 10 3 ### 输出样例#1: 10 7942 46

题目背景

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

题目描述

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)

输入输出格式

输入格式


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

输出格式


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.

输入输出样例

输入样例 #1

\n3\n2\n10\n3\n\n

输出样例 #1

\n10\n7942\n46