#P4921. Couples Seating Arrangement

    ID: 18162 Type: Default 1000ms 256MiB

Couples Seating Arrangement

Couples Seating Arrangement

There are (n) couples (i.e. (2n) people) coming to watch a movie in a cinema. The cinema has exactly (n) rows of seats, and each row contains exactly 2 seats (i.e. a total of (2n) seats). All (2n) people sit randomly in the seats so that every seat is occupied. A couple is said to be harmonious if both members of the couple are seated in the same row.

Your task is to compute, for every (k=0,1,\ldots,n), the number of different seating arrangements where exactly (k) couples are harmonious. Two seating arrangements are considered different if there exists at least one person sitting in a different seat. Since the answer might be large, output the result modulo (998244353).

The final answer should be an array of (n+1) numbers, where the (i)-th number (0-indexed) represents the number of seating arrangements with exactly (i) harmonious couples.

inputFormat

The input consists of a single integer (n) ((1 \le n \le 10^5)) representing the number of couples (and also the number of rows in the cinema).

outputFormat

Output (n+1) space‐separated integers. The (k)-th integer (starting from (k=0)) should denote the number of seating arrangements where exactly (k) couples are harmonious, taken modulo (998244353).

sample

1
0 2