#include <bits/stdc++.h>
using namespace std;
int n, m, h, a[5004];
long long ans, f[5004][5004];
struct MoquE {
  int qued[5004], head, tail;
  MoquE() { head = 1, tail = 0; }
  void updat(int id, int wei) {
    while (head <= tail && qued[head] <= id - h) head++;
    while (head <= tail && f[qued[tail]][wei] <= f[id][wei]) tail--;
    tail++, qued[tail] = id;
  }
  int query(int id) { return qued[head]; }
} que[5004];
int main() {
  scanf("%d%d%d", &n, &h, &m);
  if (n / h > m) {
    printf("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(f, 896, sizeof f);
  f[0][0] = 0;
  que[0].updat(0, 0);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m && j <= i; j++) {
      if (que[j - 1].query(i) <= i - h - 1) continue;
      f[i][j] = f[que[j - 1].query(i)][j - 1] + a[i];
    }
    for (int j = 1; j <= m && j <= i; j++) que[j].updat(i, j);
    if (i >= n - h + 1) ans = max(ans, f[i][m]);
  }
  printf("%lld", ans);
  return 0;
}
