F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Cube Summation

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 153428/153428 K (Java/Others)
Total Submission(s): 105    Accepted Submission(s): 39


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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 13:11:50, Gzip enabled