P6112 [CF2039F1] Shohag Loves Counting (Easy Version)
NOI
题目描述

This is the easy version of the problem. The only differences between the two versions of this problem are the constraints on $t$, $m$, and the sum of $m$. You can only make hacks if both versions of the problem are solved.

For an integer array $a$ of length $n$, define $f(k)$ as the greatest common divisor (GCD) of the maximum values of all subarrays$^{\text{∗}}$ of length $k$. For example, if the array is $[2, 1, 4, 6, 2]$, then $f(3) = \operatorname{gcd}(\operatorname{max}([2, 1, 4]), \operatorname{max}([1, 4, 6]), \operatorname{max}([4, 6, 2])) = \operatorname{gcd}(4, 6, 6) = 2$.

An array is good if $f(i) \neq f(j)$ is satisfied over all pairs $1 \le i \lt j \le n$.

Shohag has an integer $m$. Help him count the number, modulo $998\,244\,353$, of non-empty good arrays of arbitrary length such that each element of the array is an integer from $1$ to $m$.

Input

The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The first and only line of each test case contains an integer $m$ ($1 \le m \le 10^5$).

It is guaranteed that the sum of $m$ over all test cases does not exceed $10^5$.

Output

For each test case, output an integer — the number of valid arrays modulo $998\,244\,353$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 2 5 9
样例输出
4 29 165
提示

In the first test case, the valid arrays are $[1]$, $[1, 2]$, $[2]$, and $[2, 1]$.

In the second test case, there are a total of $29$ valid arrays. In particular, the array $[2, 1, 4]$ with length $n = 3$ is valid because all elements are from $1$ to $m = 5$ and $f(1)$, $f(2)$ and $f(n = 3)$ all are distinct:

  • $f(1) = \operatorname{gcd}(\operatorname{max}([2]), \operatorname{max}([1]), \operatorname{max}([4])) = \operatorname{gcd}(2, 1, 4) = 1.$
  • $f(2) = \operatorname{gcd}(\operatorname{max}([2, 1]), \operatorname{max}([1, 4])) = \operatorname{gcd}(2, 4) = 2.$
  • $f(3) = \operatorname{gcd}(\operatorname{max}([2, 1, 4])) = \operatorname{gcd}(4) = 4.$