#P7539. [2017年杭电多校]Cube Summation
[2017年杭电多校]Cube Summation
Cube Summation
Problem Description
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.
Input
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).
Output
For each test case, output one line with a single integer, denoting the answer to the problem.
Sample Input
4
1
2
3
100000
Sample Output
1
9
36
513842114
Hint
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.
Source
2017 Multi-University Training Contest - Team 10