atcoder#ASAPOROD. ストラックアウト

ストラックアウト

Score : 700700 points

Problem Statement

There are NN panels arranged in a row in Takahashi's house, numbered 11 through NN. The ii-th panel has a number AiA_i written on it. Takahashi is playing by throwing balls at these panels.

Takahashi threw a ball KK times. Let the panel hit by a boll in the ii-th throw be panel pip_i. He set the score for the ii-th throw as i×Apii \times A_{p_i}.

He was about to calculate the total score for his throws, when he realized that he forgot the panels hit by balls, p1,p2,...,pKp_1,p_2,...,p_K. The only fact he remembers is that for every ii (1iK1)(1 \leq i \leq K-1), 1pi+1piM1 \leq p_{i+1}-p_i \leq M holds. Based on this fact, find the maximum possible total score for his throws.

Constraints

  • 1MN100,0001 \leq M \leq N \leq 100,000
  • 1Kmin(300,N)1 \leq K \leq min(300,N)
  • 1Ai1091 \leq A_i \leq 10^{9}

Partial Scores

  • In the test set worth 100100 points, M=NM = N.
  • In the test set worth another 200200 points, N300N \leq 300 and K30K \leq 30.
  • In the test set worth another 300300 points, K30K \leq 30.

Input

The input is given from Standard Input in the following format:

NN MM KK

A1A_1 A2A_2ANA_N

Output

Print the maximum possible total score for Takahashi's throws.

5 2 3
10 2 8 10 2
56

The total score is maximized when panels 1,31,3 and 44 are hit, in this order.

5 5 2
5 2 10 5 9
28

This case satisfies the additional constraint M=NM = N for a partial score.

10 3 5
3 7 2 6 9 4 8 5 1 1000000000
5000000078