#d2927. 贪就是了

贪就是了

Just Be Greedy

Problem Description

You are given a sequence aa. Define

S(l,r)=∑i=lrai.S_{(l, r)} = \sum_{i = l}^{r} a_i.

Clearly there are n(n+1)2\frac{n(n + 1)}{2} different values S(l,r)S_{(l, r)}. Output the kk largest ones among them.

Input Format

The first line contains two integers nn and kk.

The second line contains nn integers representing the sequence aa.

Output Format

Output one line containing kk integers, the answer.

Sample Input 1

6 8
1 1 4 5 1 4

Sample Output 1

16 15 14 12 11 11 10 10

Sample Input 2

7 8
1 9 1 9 8 1 0

Sample Output 2

29 29 28 28 28 27 20 19

Constraints

$0 \le a_i \le 10^9,\ 1 \le n \le 10^5,\ 1 \le k \le \min(10^5, n(n + 1) / 2)$.