#P8106. Partitioning Set with Forbidden Subset Sizes

    ID: 21289 Type: Default 1000ms 256MiB

Partitioning Set with Forbidden Subset Sizes

Partitioning Set with Forbidden Subset Sizes

Given a set \(U = \{1,2,3,\ldots, n\}\), partition it into two subsets \(S\) and \(T\) (with \(S \cup T = U\) and \(S \cap T = \emptyset\)) such that both of the following conditions hold:

  • \(|S| \notin S\)
  • \(|T| \notin T\)

Compute the number of such partitions modulo \(998244353\).

Note: The size of a subset is defined as the number of elements it contains.

inputFormat

The input consists of a single integer \(n\) (\(1 \le n \le 10^6\)), representing the number of elements in the set \(U\).

outputFormat

Output a single integer, the number of valid partitions modulo \(998244353\).

sample

1
0