RoAlgo Contest #5 - Back to School Edition | ursul

This was the problem page during the contest. Access the current page here.
Time limit: 0.05s Memory limit: 16MB Input: Output:

"To give the bear a high five"

Andrei solved the problem excursion and then thought of going on an excursion in the forest. When he returned, there was a bear at the exit of the forest. The bear asked him TT questions in the form: "I give you a natural number NN. Tell me the value of CN0(N+0)+CN1(N+1)+CN2(N+2)++CNN(N+N)C_N^0 \cdot (N + 0) + C_N^1 \cdot (N + 1) + C_N^2 \cdot (N + 2) + \dots + C_N^N \cdot (N + N)." Here, CNKC_N^K denotes the combinations of NN taken KK at a time. Andrei doesn't know how to solve the problem, so he asks you to solve it.

Task

For each number NN given by the bear, you need to compute the value of CN0(N+0)+CN1(N+1)+CN2(N+2)++CNN(N+N)C_N^0 \cdot (N + 0) + C_N^1 \cdot (N + 1) + C_N^2 \cdot (N + 2) + \dots + C_N^N \cdot (N + N), more formally i=0NCNi(N+i)\sum_{i=0}^{N} C_N^i \cdot (N + i). Since these numbers can be very large, you need to display them modulo 998 244 353998 \ 244 \ 353.

Input data

The first line contains the number TT. Then, for ii from 11 to TT, the (i+1)(i+1)-th line contains a number NN, representing the number given by the bear for the ii-th question.

Output data

The output contains TT lines, each line ii containing a single number representing the answer to the bear's ii-th question, modulo 998 244 353998 \ 244 \ 353.

Constraints and clarifications

  • 1T101 \leq T \leq 10
  • 1N10181 \leq N \leq 10^{18}
# Score Constraints
0 0 Example
1 5 N100N \leq 100
2 12 N2103N \leq 2 \cdot 10^3
3 16 N2106N \leq 2 \cdot 10^6
4 22 N107N \leq 10^7
5 45 No additional constraints

Example

stdin

4
2 
6
2344
5459875

stdout

12
576
47421958
201586235

Explanation

For the first test, C20(2+0)+C21(2+1)+C22(2+2)=C_2^0 \cdot (2 + 0) + C_2^1 \cdot (2 + 1) + C_2^2 \cdot (2 + 2) = 12+23+14=2+6+4=121 \cdot 2 + 2 \cdot 3 + 1 \cdot 4 = 2 + 6 + 4 = 12, and 12 mod 998 244 353=1212 \text{ mod } 998 \ 244 \ 353 = 12, so the answer is 1212.

For the second test, C60(6+0)+C61(6+1)+C62(6+2)+C63(6+3)+C64(6+4)+C65(6+5)+C66(6+6)=16+67+158+209+1510+611+112=6+42+120+180+150+66+12=576C_6^0 \cdot (6 + 0) + C_6^1 \cdot (6 + 1) + C_6^2 \cdot (6 + 2) + C_6^3 \cdot (6 + 3) + C_6^4 \cdot (6 + 4) + C_6^5 \cdot (6 + 5) + C_6^6 \cdot (6 + 6) = 1 \cdot 6 + 6 \cdot 7 + 15 \cdot 8 + 20 \cdot 9 + 15 \cdot 10 + 6 \cdot 11 + 1 \cdot 12 = 6 + 42 + 120 + 180 + 150 + 66 + 12 = 576, and 576 mod 998 244 353=576576 \text{ mod } 998 \ 244 \ 353 = 576, so the answer is 576576.

Log in or sign up to be able to send submissions!