| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 84 | 52 | 45 | 63.380% |
A group of scouts are preparing to go to a large meeting with other scouts. Their leader Hildeborg, in spirit of the scout motto "be prepared", wants to distribute some useful items among the scouts that they most probably will need on their adventure. The items come in different sizes, so to make this as fair as possible, she wants to make sure that the total size of items carried by any scout is as small as possible. Furthermore, Hildeborg does not want to give more than two items to any scout as she is afraid that it otherwise will be too hard for them to remember to bring everything. Given the sizes of the items, what is the least maximum total size, computed as the sum of items, any scout will have to carry?
The first line of input contains two positive integers $N$ and $M$ (1ドル \leq N \leq 2M,ドル 1ドル \leq M \leq 100$). $N$ is the number of useful items, and $M$ is the number of scouts. The second line contains $N$ positive integers $a_i$ (1ドル \leq a_i\leq 10^7$) giving the sizes of the items.
Print one integer, the smallest total size that any scout has to carry.
3 4 10 10 10
10
5 4 9 12 3 9 10
12
ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2023 J번