Logo
(追記) (追記ここまで)

19473번 - Value of the Array 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB27151470.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円$.

제한

예제 입력 1

3
1 1 1

예제 출력 1

7 11 12

예제 입력 2

5
1 2 3 4 5

예제 출력 2

129 201 231 239 240

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2016 > Day 4: Ce Bin and Ryyi Ji Contest 1 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /