AtCoder Regular Contest 160
B
Triple Pair
AtCoder
⌀ 1275
原题
← AC →
翻译中…

Problem Statement

翻译中…

You are given a positive integer $N$.

翻译中…

Find the number, modulo $998244353$, of triples of positive integers $(x,y,z)$ that satisfy the following condition.

翻译中…
  • All of $xy$, $yz$, $zx$ are less than or equal to $N$.
翻译中…

You have $T$ test cases to solve.

翻译中…

Constraints

翻译中…
  • $1 \le T \le 100$
  • $1 \le N \le 10^9$
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format, where $\mathrm{case}_i$ represents the $i$-th test case:

翻译中…

T
\mathrm{case}_1
\mathrm{case}_2
\vdots
\mathrm{case}_T

翻译中…

Each test case is in the following format:

翻译中…

N

翻译中…

Output

翻译中…

Print $T$ lines. The $i$-th line $(1 \le i \le T)$ should contain the answer for the $i$-th test case.

翻译中…

样例

Input #1
4
1
2
5
998244353
Output #1
1
4
17
727512986
In the first test case, $N=1$. There is one triple $(x,y,z)$ that satisfies the condition: $(1,1,1)$. In the second test case, $N=2$. There are four triples $(x,y,z)$ that satisfy the condition: $(1,1,1),(2,1,1),(1,2,1),(1,1,2)$.
题目信息
题号
arc160_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。