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

30441번 - Jamboree 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB84524563.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.

제한

예제 입력 1

3 4
10 10 10

예제 출력 1

10

예제 입력 2

5 4
9 12 3 9 10

예제 출력 2

12

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2023 J번

  • 문제를 만든 사람: Andreas Björklund
(追記) (追記ここまで)

출처

대학교 대회

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

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