Codeforces Round 722 (Div. 1)
B
Kavi on Pairing Duty
Codeforces
1700
原题
← AC →
翻译中…

Kavi has $2n$ points lying on the $OX$ axis, $i$-th of which is located at $x = i$.

翻译中…

Kavi considers all ways to split these $2n$ points into $n$ pairs. Among those, he is interested in good pairings, which are defined as follows:

翻译中…

Consider $n$ segments with ends at the points in correspondent pairs. The pairing is called good, if for every $2$ different segments $A$ and $B$ among those, at least one of the following holds:

翻译中…
  • One of the segments $A$ and $B$ lies completely inside the other.
  • $A$ and $B$ have the same length.
翻译中…

Consider the following example:

翻译中…

image

翻译中…

$A$ is a good pairing since the red segment lies completely inside the blue segment.

翻译中…

$B$ is a good pairing since the red and the blue segment have the same length.

翻译中…

$C$ is not a good pairing since none of the red or blue segments lies inside the other, neither do they have the same size.

翻译中…

Kavi is interested in the number of good pairings, so he wants you to find it for him. As the result can be large, find this number modulo $998244353$.

翻译中…

Two pairings are called different, if some two points are in one pair in some pairing and in different pairs in another.

翻译中…

Input

翻译中…

The single line of the input contains a single integer $n$ $(1\le n \le 10^6)$.

翻译中…

Output

翻译中…

Print the number of good pairings modulo $998244353$.

翻译中…

Note

翻译中…

The good pairings for the second example are:

翻译中…

image

翻译中…

In the third example, the good pairings are:

翻译中…

image

翻译中…

样例

Input #1
1
Output #1
1
InputCopy OutputCopy
Input #2
2
Output #2
3
InputCopy OutputCopy
Input #3
3
Output #3
6
InputCopy OutputCopy
Input #4
100
Output #4
688750769
InputCopy OutputCopy
题目信息
题号
1528B
时间限制
1 s
内存限制
256 MB
标签
组合数学
动态规划
数学

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