#P7275. 计树

计树

Description

Find how many different labeled unrooted trees with nn vertices satisfy the following condition: for every vertex xx, there exists a vertex yy such that there is an edge between xx and yy, and xy=1|x - y| = 1. Output the answer modulo 998244353998244353.

Input Format

One line with one positive integer nn.

Output Format

One line with one integer, the required answer.

4
4
209
21754876
5
11
6
56

Hint

[Sample Explanation #1]

无标题.png

The 44 trees in Sample #1 that satisfy the condition are shown in the figure above.


[Constraints]

This problem contains 2020 test points, with 55 points for each test point.

Test point ID Range of nn
121 \sim 2 7\leq 7
343 \sim 4 14\leq 14
585 \sim 8 30\leq 30
9129 \sim 12 103\leq 10^3
132013 \sim 20 105\leq 10^5

For all test points, nn is a positive integer and 2n1052 \leq n \leq {10}^5

Translated by ChatGPT 5