시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB133473648.000%

문제

Given a multiset of integers $A = \{a_1, a_2, \dots, a_n\}$, print the least $k$ sums among all non-empty subsets in sorted order.

입력

The first line contains $2$ integers $n, k$ ($1 \leq n \leq 200000, 1 \leq k \leq \min\{2^n - 1, 200000\}$).

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($|a_i| \leq 10^9$).

출력

$k$ integers denote the least $k$ sums.

예제 입력 1

2 3
-1 1

예제 출력 1

-1
0
1

예제 입력 2

3 7
-1 0 1

예제 출력 2

-1
-1
0
0
0
1
1