Problem Statement
There are $N$ trees. On Day $0$, each tree bears no fruits.
On the morning of Day $1$ and subsequent days, the $i$-th tree bears $i$ new fruits for each $i = 1, 2, \ldots, N$.
Takahashi will perform $Q$ harvesting. For each $i = 1, 2, \ldots, Q$, the $i$-th harvesting takes place on the night of Day $D_i$, collecting all fruits remaining on the $L_i$-th through $R_i$-th trees at that point.
For each of the $Q$ harvesting, print the number of fruits Takahashi will collect, modulo $998244353$.
Constraints
$1 \leq N \leq 10^{18}$$1 \leq Q \leq 2 \times 10^5$$1 \leq D_1 \lt D_2 \lt \cdots \lt D_Q \leq 10^{18}$$1 \leq L_i \leq R_i \leq N$- All values in input are integers.
Input
Input is given from Standard Input in the following format:
N Q
D_1 L_1 R_1
D_2 L_2 R_2
\vdots
D_Q L_Q R_Q
Output
Print $Q$ lines. For each $i = 1, 2, \ldots, Q$, the $i$-th line should contain the number of fruits Takahashi will collect in the $i$-th harvesting, modulo $998244353$.
样例
5 3
2 2 3
3 3 4
5 1 5
10
15
50
711741968710511029 1
82803157126515475 516874290286751784 588060532191410838
603657470
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。