P24783 [AtCoder] Count Arithmetic Subsequences
普及+
题目描述

Problem Statement

You are given $a sequence A = (A_1, A_2, \dots, A_N)$ of length N. For each $k = 1, 2, \dots, N,$ find the number, modulo 998244353, of (not necessarily contiguous) subsequences of A of length k that are arithmetic sequences. Two subsequences are distinguished if they are taken from different positions, even if they are equal as sequences.

What is a subsequence?
A subsequence of a sequence A is a sequence obtained by deleting zero or more elements from A and arranging the remaining elements without changing the order.

Input

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

Output

Print the answers for $k = 1, 2, \dots, N$ in this order, in a single line, separated by spaces.

Constraints

  • $1 \leq N \leq 80$
  • $1 \leq A_i \leq 10^9$
  • All input values are integers.

Sample Input 1

5
1 2 3 2 3

Sample Output 1

5 10 3 0 0

  • There are 5 subsequences of length 1, all of which are arithmetic sequences.
  • There are 10 subsequences of length 2, all of which are arithmetic sequences.
  • There are 3 subsequences of length 3 that are arithmetic sequences: (A_1, A_2, A_3), (A_1, A_2, A_5), and (A_1, A_4, A_5).
  • There are no arithmetic subsequences of length 4 or more.

Sample Input 2

4
1 2 3 4

Sample Output 2

4 6 2 1

Sample Input 3

1
100

Sample Output 3

1

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 1 2 3 2 3
样例输出
5 10 3 0 0