AT_awtf2026algo_c Count by Descents

Description

Define the **score** of a sequence of length $ N $ , $ x=(x_1,x_2,\ldots,x_N) $ , as $ \prod_{1 \leq i \leq N} (i+x_i) $ . You are given a strictly increasing sequence of non-negative integers of length $ N $ , $ A=(A_1,A_2,\ldots,A_N) $ . Solve the following problem for each $ d=0,1,\ldots,N-1 $ . - Consider the sequences $ x $ obtained by rearranging the elements of $ A $ such that there are exactly $ d $ indices $ i $ with $ x_i>x_{i+1} $ . Find, modulo $ 998244353 $ , the sum of the scores over all such sequences.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $

Output Format

For each $ d=0,1,\ldots,N-1 $ in this order, output the answer.

Explanation/Hint

### Sample Explanation 1 The permutations and scores corresponding to each $ d $ are as follows. - $ d=0 $ : - $ x=(0,1) $ : the score is $ (1+0) \times (2+1)=3 $ - $ d=1 $ : - $ x=(1,0) $ : the score is $ (1+1) \times (2+0)=4 $ ### Sample Explanation 2 The permutations and scores corresponding to each $ d $ are as follows. - $ d=0 $ : - $ x=(0,1,2) $ : the score is $ (1+0) \times (2+1) \times (3+2)=15 $ - $ d=1 $ : - $ x=(0,2,1) $ : the score is $ (1+0) \times (2+2) \times (3+1)=16 $ - $ x=(1,0,2) $ : the score is $ (1+1) \times (2+0) \times (3+2)=20 $ - $ x=(1,2,0) $ : the score is $ (1+1) \times (2+2) \times (3+0)=24 $ - $ x=(2,0,1) $ : the score is $ (1+2) \times (2+0) \times (3+1)=24 $ - $ d=2 $ : - $ x=(2,1,0) $ : the score is $ (1+2) \times (2+1) \times (3+0)=27 $ ### Constraints - $ 2 \leq N \leq 80 $ - $ 0 \leq A_1 < A_2 < \cdots < A_N < 998244353 $ - All input values are integers.