Calculate sum
时间限制:C/C++/Rust/Pascal 6秒,其他语言12秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

You are given an array of integers a_1, \ a_2, \ \dots , \ a_n.

Define b_{i,j}(1 \le i <j \le n )= a_1, \ a_2, \ \dots \ , \ a_{i-1}, \ a_j, \ a_{j-1}, \ \dots \ , \ a_{i+1}, \ a_i, \ a_{j+1}, \dots \ , \ a_n. Which means you choose two indexes i and j, then reverse a_i,\ a_{i+1}, \ \dots \, \ a_{j-1}, \ a_j.

You should calculate for k=2 to 2\times n, (\sum_{i=1}^{n} \sum_{j=i+1}^{n} \sum_{1 \le x,y \le n, \ x+y=k} (b_{i,j})_x \times (b_{i,j})_{y}) modulo 998244353.

输入描述:

The first line contains a positive integer n(2 \le n \le 10^5).

The second line contains n integers a_1,a_2,\dots ,a_n(0 \le a_i \le 10^8).

输出描述:

Output 2 \times n-1 lines, each of which contains a single integer , denoting the answer taken modulo 998244353---the i-th number is for the answer of k=i+1(1\le i \le 2 \times n-1).
示例1

输入

复制
5
2 4 8 7 5

输出

复制
178
390
707
1022
1341
1232
995
612
283