AtCoder Beginner Contest 440 (Promotion of Engineer Guild Fes)
E
Cookies
AtCoder
⌀ 1603
原题
←G →
翻译中…

Problem Statement

翻译中…

There are $10^{100}$ cookies of each of $N$ types. The deliciousness per cookie of the $i$-th type is $A_i$.

翻译中…

You will choose a total of $K$ cookies from these. Two ways of choosing cookies are considered the same if and only if the multisets of types of chosen cookies match.

翻译中…

For each of the $\binom{N+K-1}{K}$ ways of choosing, consider the sum of deliciousness of the chosen cookies. Let $S_1,S_2,\dots$ be these sums in descending order, with duplicates included. Find $S_1,\dots,S_X$.

翻译中…

Constraints

翻译中…
  • $1\leq N \leq 50$
  • $1 \leq K \leq 10^5$
  • $1 \leq X \leq \min\left(10^5, \binom{N+K-1}{K}\right)$
  • $-10^9 \leq A_i \leq 10^9$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N K X
A_1 \dots A_N

翻译中…

Output

翻译中…

Let $S_1,S_2,\dots$ be the possible sums of deliciousness of the chosen $K$ cookies in descending order, with duplicates included. Output $S_1,\dots,S_X$ in this order, separated by newlines.

翻译中…

样例

Input #1
2 4 3
20 10
Output #1
80
70
60
There are $5$ ways to choose $4$ cookies: "$k$ cookies of type $1$ and $4-k$ cookies of type $2$" $(0\leq k \leq 4)$, where the sums of deliciousness of the chosen cookies are $80,70,60,50,40$.
Input #2
3 100000 5
-1 -1 -1
Output #2
-100000
-100000
-100000
-100000
-100000
Different ways of choosing cookies may result in the same sum of deliciousness.
Input #3
9 14142 13
31 41 59 26 53 58 97 93 23
Output #3
1371774
1371770
1371766
1371762
1371758
1371754
1371750
1371746
1371742
1371738
1371736
1371735
1371734
题目信息
题号
abc440_e
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。