Responsive image

问题 E: Cube Summation

问题 E: Cube Summation

时间限制: 10 Sec  内存限制: 128 MB
提交: 1  解决: 1
[提交][状态][讨论版][命题人:]

题目描述

Given an integer N, consider all multi-sets of positive integers such that their sum is N.
For example, if N =3, there are three possible multi-sets {1, 1, 1}, {1, 2}, {3}.
For each multi-set calculate the cube of its size and output the sum of all these values modulo 998244353.
 

输入描述

The first line of input contains an integer T (1<= T <=10000), the number of test cases.
Each test case contains a single integer N (1<= N<=100000).
 

输出描述

For each test case, output one line with a single integer, denoting the answer to the problem.
 

样例输入

4
1
2
3
100000

样例输出

1
9
36
513842114

提示

For the 1st case, the only possible multi-set is {1}. So the answer is 1^3=1.
For the 2nd case, there are 2 possible multi-sets. {1, 1}, {2}. So the answer is 2^3+1^3=9.
For the 3rd case, there are 3 possible multi-sets. {1, 1, 1}, {1, 2}, {3}. So the answer is 3^3+2^3+1^3=36.

[提交][状态]
ACM算法攻关部