시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB63729823347.942%

문제

Juicy Orange Industry(JOI)는 맛있는 오렌지를 포장해서 출하하는 것이 주된 업무인 회사이다. 

JOI사에서는 수집한 N개의 오렌지를 상자에 넣어서 출하한다. 먼저, 오렌지는 공장에 있는 컨베이어 벨트 위에 나란히 놓아야 한다. 컨베이어 벨트 위에 놓여져있는 오렌지는 앞에서부터 순서대로 1부터 N까지 번호가 붙여져 있다. i번째 오렌지의 크기는 Ai이다.

그 다음 작업은 오렌지를 앞에서부터 순서대로 상자에 나눠서 넣는 것이다. 한 상자 넣는 오렌지의 번호는 연속해야 한다.

한 상자에는 최대 M개의 오렌지를 넣을 수 있다. 상자에 오렌지를 넣는 비용은 K + s × (a − b) 로 구할 수 있다. 여기서 a는 상자에 넣은 가장 큰 오렌지의 크기, b는 상자에 넣은 가장 작은 오렌지의 크기, s는 상자에 넣은 오렌지의 개수이다. K는 상자를 포장하는 비용이고, 모든 상자에 공통적으로 적용되는 값이다.

컨베이어 벨트 위에 놓여져 있는 오렌지의 정보와, 한 상자에 넣을 수 있는 오렌지 개수의 최댓값, 상자를 포장하는 비용 K가 주어졌을 때, 모든 오렌지를 포장하는 비용의 최솟값을 구하는 프로그램을 작성하시오.

입력

첫째 줄에 오렌지의 개수 N (1 ≤ N ≤ 20,000), 한 상자에 넣을 수 있는 오렌지 개수의 최댓값 M (1 ≤ M ≤ 1,000, M ≤ N), 상자를 포장하는 비용 K (0 ≤ k ≤ 1,000,000,000)가 주어진다.

둘째 줄부터 N개의 줄에는 오렌지의 크기 Ai (1 ≤ Ai ≤ 1,000,000,000)가 순서대로 주어진다. 

출력

첫째 줄에 모든 오렌지를 포장하는 비용의 최솟값을 출력한다.

서브태스크

번호배점제한
120

N ≤ 20.

250

N ≤ 2 000, M ≤ 100.

330

추가적인 제약 조건이 없다.

예제 입력 1

6 3 6
1
2
3
1
2
1

예제 출력 1

21

예제 입력 2

16 4 12
3
10
13
10
19
9
12
16
11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Fx1MzA2Zlx1OTY1MFx1MzA4OVx1MzA2YVx1MzA0NFx1MzA1M1x1MzA2OFx1MzA2Ylx1NmNlOFx1NjEwZlx1MzA1Ylx1MzA4OFx1ZmYwZTxcL3A+XHJcbiJ9XQ==

출처

Olympiad > Japanese Olympiad in Informatics > JOI 2016 1번

  • 문제의 오타를 찾은 사람: khj94811
  • 문제를 번역한 사람: KimJJ

채점 및 기타 정보

  • 예제는 채점하지 않는다.