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

30561번 - Delivery Forces 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB70504374.138%

문제

Gry finally becomes the Executive Courier Officer in "Universe Express". He has $n$ subordinate couriers with some delivery strength $f_i$. The delivery strength of a team of three people is the median of their strength, i.e., the middle element after the sorting. Please help Gry to split the couriers into $k$ teams of three people in order to maximize the total delivery strength of "Universe Express". The total strength is the sum of the strength of these $k$ teams.

입력

  • One line containing the number of couriers in the company, $n$ (1ドル \leq n \leq 10^6$), where $n$ is a multiple of 3ドル$.
  • One line containing the strengths of the $n$ couriers $f_1$ $\ldots$ $f_n$ (1ドル \le f \le 10^6$).

출력

The sole line of the output should contain the maximal strength of "Universe Express".

제한

예제 입력 1

3
1 2 3

예제 출력 1

2

예제 입력 2

6
5 6 2 3 1 4

예제 출력 2

8

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2023 D번

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

출처

대학교 대회

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

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