P24499 [AtCoder] Diff Adjacent
省选
题目描述

Problem Statement

A positive-integer sequence is said to be splendid if no two adjacent elements are equal.
Find the sum, modulo 998244353, of the lengths of all splendid sequences whose elements have a sum of N.

Input

The input is given from Standard Input in the following format:
N

Output

Print the answer.

Constraints

  • $1 \le N \le 2 \times 10^5$
  • All values in the input are integers.

Sample Input 1

4

Sample Output 1

8

There are four splendid sequences whose sum is 4: (4),(1,3),(3,1),(1,2,1). Thus, the answer is the sum of their lengths: 1+2+2+3=8.
(2,2) and (1,1,2) also have a sum of 4 but ineligible because their 1-st and 2-nd elements are the same.

Sample Input 2

297

Sample Output 2

475867236

Sample Input 3

123456

Sample Output 3

771773807

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4
样例输出
8