问题 D: Do You Like Interactive Problems?

内存限制:512 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:3 通过:2

题目描述

There is an integer x satisfying 1≤�≤�1xn. You know n but you don't know x.

You can do the following guessing: pick an random integer y uniformly satisfying 1≤�≤�1yn (your y may equal to previous queries), and you will be told if �<�x<y�>�x>y or �=�x=y. You will stop asking if there is only one possible x satisfying all the conditions.

Given n, if x is picked randomly uniformly, what's your expected number of queries?

输入格式

The first line contains an integer T (1≤�≤1001T100) denoting the number of test cases.

For each test case, the only line contains an integer n (1≤�≤1091n109).

输出格式

For each test case, output one integer denoting the expected number of queries modulo 998244353998244353.

Formally, it can be proven that the sought expected value can be represented as an irreducible fraction �/�p/q which satisfies �≢0mod998244353q0mod998244353, and there is a unique integer r satisfies 0≤�<9982443530r<998244353 and ��≡�mod998244353qrpmod998244353. Find this r.

输入样例 复制

2
1
2

输出样例 复制

0
1