| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 27 | 15 | 14 | 70.000% |
Yuta has a sequence of $n$ integers $a_1, \ldots, a_n$ and a number $k$. For any non-empty subsequence $S$ of this sequence, the value of $S$ is defined as the sum of the largest $\min(|S|, k)$ numbers in $S$. The value of the array $a$ is equal to the sum of the values of all its non-empty subsequences.
Now Yuta shows the $n$ integers, and he wants to know the value of the array for each $k$ in $[1, n]$.
The first line of the input contains an integer $n$ (1ドル \le n \le 10^5$), the length of the sequence Yuta has. The second line contains $n$ integers $a_1, \ldots, a_n$ (0ドル \le a_i \le 10^9$), the sequence itself.
Print a line that contains exactly $n$ integers. The $i$-th number mjust be the value of the array when $k = i$. The answers may be very large, so you must print them modulo 998ドル,244円,353円$.
3 1 1 1
7 11 12
5 1 2 3 4 5
129 201 231 239 240