#P10128. 「Daily OI Round 3」Xor Graph

「Daily OI Round 3」Xor Graph

Background

Before dawn arrives, someone must light up the darkness.

Problem Description

Xs_siqi gives you 2n2^n vertices. There is a directed edge from xx to yy if and only if xxory=2kx \operatorname{xor} y = 2^k, k[0,n)k \in [0,n), and x>yx > y. Here, xor\operatorname{xor} means bitwise XOR, and kk is an integer. Let fx,yf_{x,y} be the number of different paths from vertex xx to vertex yy. Find:

i=12nj=12nfi,j(ij)\sum_{i=1}^{2^n}\sum_{j=1}^{2^n}f_{i,j}(i\neq j)

Output the answer modulo 998244353998244353.

Input Format

The first line contains an integer tt.

The next tt lines (lines 22 to t+1t+1) each contain an integer nn.

Output Format

Output tt lines. Each line contains an integer representing the number of valid paths required by the problem.

4
2
3
50
999998
2
15
599192517
81627972

Hint

Sample Explanation #1

For the first test case of the sample, vertex 33 has edges to 11 and 22. Then there is one path from 33 to 11 and one path from 33 to 22, for a total of 22 paths.

Constraints

For all testdata: 1t1061 \le t \le 10^6, 1n1071 \le n \le 10^7.

Translated by ChatGPT 5