"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 T questions in the form: "I give you a natural number N. Tell me the value of CN0⋅(N+0)+CN1⋅(N+1)+CN2⋅(N+2)+⋯+CNN⋅(N+N)." Here, CNK denotes the combinations of N taken K at a time. Andrei doesn't know how to solve the problem, so he asks you to solve it.
Task
For each number N given by the bear, you need to compute the value of CN0⋅(N+0)+CN1⋅(N+1)+CN2⋅(N+2)+⋯+CNN⋅(N+N), more formally ∑i=0NCNi⋅(N+i). Since these numbers can be very large, you need to display them modulo 998 244 353.
The first line contains the number T. Then, for i from 1 to T, the (i+1)-th line contains a number N, representing the number given by the bear for the i-th question.
Output data
The output contains T lines, each line i containing a single number representing the answer to the bear's i-th question, modulo 998 244 353.
Constraints and clarifications
- 1≤T≤10
- 1≤N≤1018
# |
Score |
Constraints |
0 |
0 |
Example |
1 |
5 |
N≤100 |
2 |
12 |
N≤2⋅103 |
3 |
16 |
N≤2⋅106 |
4 |
22 |
N≤107 |
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)= 1⋅2+2⋅3+1⋅4=2+6+4=12, and 12 mod 998 244 353=12, so the answer is 12.
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)=1⋅6+6⋅7+15⋅8+20⋅9+15⋅10+6⋅11+1⋅12=6+42+120+180+150+66+12=576, and 576 mod 998 244 353=576, so the answer is 576.