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

22652번 - Round Table 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 512 MB14000.000%

문제

You are the owner of a restaurant, and you are serving for N customers seating in a round table.

You will distribute M menus to them. Each customer receiving a menu will make the order of plates, and then pass the menu to the customer on the right unless he or she has not make the order. The customer i takes Li unit time for the ordering.

Your job is to write a program to calculate the minimum time until all customers to call their orders, so you can improve your business performance.

입력

The input consists of a sequence of positive integers.

The first line of the input contains two positive integers N (N ≤ 50,000) and M (MN). The second line contains N positive integers L1, L2,..., LN (Li ≤ 600).

출력

Output the minimum possible time required for them to finish ordering.

제한

예제 입력 1

3 2
1 5 10

예제 출력 1

10

예제 입력 2

4 2
1 2 3 4

예제 출력 2

5

힌트

출처

Contest > ICPC Japanese Alumni Group > JAG Winter Camp > JAG Winter Camp 2009 Day 3 H번

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

출처

대학교 대회

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

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