Codeforces Round 267 (Div. 2)
C
George and Job
Codeforces
1700
原题
← BD →
翻译中…

The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced the following problem at the work.

翻译中…

Given a sequence of $*n*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$. You are to choose $*k*$ pairs of integers:

翻译中…

$[*l*_{1}, *r*_{1}], [*l*_{2}, *r*_{2}], ..., [*l*_{*k*}, *r*_{*k*}] (1 ≤ *l*_{1} ≤ *r*_{1} < *l*_{2} ≤ *r*_{2} < ... < *l*_{*k*} ≤ *r*_{*k*} ≤ *n*; *r*_{*i*} - *l*_{*i*} + 1 = *m*),$

翻译中…

in such a way that the value of sum image is maximal possible. Help George to cope with the task.

翻译中…

Input

翻译中…

The first line contains three integers $*n*$, $*m*$ and $*k*$ $(1 ≤ (*m* × *k*) ≤ *n* ≤ 5000)$. The second line contains $*n*$ integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ $(0 ≤ *p*_{*i*} ≤ 10^{9})$.

翻译中…

Output

翻译中…

Print an integer in a single line — the maximum possible value of sum.

翻译中…

样例

Input #1
5 2 1
1 2 3 4 5
Output #1
9
InputCopy OutputCopy
Input #2
7 1 3
2 10 7 18 5 33 0
Output #2
61
InputCopy OutputCopy
题目信息
题号
467C
时间限制
1 s
内存限制
256 MB
标签
动态规划
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。