This page is still under construction.

Parts of this page are still being built. What you see may change.

Cube Summation

Time limit4sMemory limit512 MB

Summary
For each N, sum k^3 over all partitions of N with k parts, modulo 998244353, with up to 1e5 queries.
Level

Medium7 of 10

Topics
Dynamic programming, Combinatorics, Math, Prefix sum
Solved
No attempts yet

Problem

Given an integer NN, consider all multi-sets of positive integers whose sum is NN.

For example, when N=3N = 3, there are three possible multi-sets: {1,1,1}\{1, 1, 1\}, {1,2}\{1, 2\}, and {3}\{3\}.

For each multi-set, compute the cube of its size, and output the sum of these values modulo 998 244 353998\,244\,353.

Input

The first line of input contains an integer TT, the number of test cases (1≤T≤1051 \le T \le 10^5).

Each test case consists of a single line containing a single integer NN (1≤N≤1051 \le N \le 10^5).

Output

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

Hint

In the first case, the only possible multi-set is {1}\{1\}. So the answer is 13=11^3 = 1.

In the second case, there are two possible multi-sets: {1,1}\{1, 1\} and {2}\{2\}. So the answer is 23+13=92^3 + 1^3 = 9.

In the third case, there are three possible multi-sets: {1,1,1}\{1, 1, 1\}, {1,2}\{1, 2\}, and {3}\{3\}. So the answer is 33+23+13=363^3 + 2^3 + 1^3 = 36.

Examples1

  1. Example 1

    Input
    4
    1
    2
    3
    100000
    
    Expected output
    1
    9
    36
    513842114