#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long n = 0, k = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') k = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    n = (n << 1) + (n << 3) + (c ^ 48), c = getchar();
  return n * k;
}
long long n, m, k;
long long arr[6000];
long long dp[6000][6000];
long long qwq[6000 << 1], head, tail;
signed main() {
  n = read(), m = read(), k = read();
  for (register long long i = 1; i <= n; ++i) arr[i] = read();
  memset(dp, -0x3f, sizeof(dp));
  dp[0][0] = 0;
  for (register long long i = 1; i <= k; ++i) {
    memset(qwq, 0, sizeof(qwq));
    head = 1, tail = 0;
    for (register long long j = 1; j <= n; ++j) {
      while (head <= tail && qwq[head] < j - m) ++head;
      while (head <= tail && (dp[i - 1][j - 1] > dp[i - 1][qwq[tail]])) --tail;
      qwq[++tail] = j - 1;
      dp[i][j] = dp[i - 1][qwq[head]] + arr[j];
    }
  }
  long long ans = -1;
  for (register long long i = n - m + 1; i <= n; ++i) ans = max(ans, dp[k][i]);
  printf("%I64d\n", ans);
  return 0;
}
