#include <bits/stdc++.h>
using namespace std;
const long long lzw = 5000 + 3;
long long n, k, m, a[lzw], f[lzw][lzw];
inline long long read() {
  long long f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) f = (c == '-' ? -1 : 1), c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return f * x;
}
struct que {
  long long q[lzw], l, r, g[lzw];
  que() {
    l = r = 1;
    memset(q, 0, sizeof(q));
    memset(g, 0, sizeof(g));
  }
  void maintain(long long x) {
    while (l < r && x - q[l] > k - 1) l++;
  }
  void clear() { l = r = 1; }
  void push(long long x, long long w) {
    g[x] = w;
    while (l < r && g[x] > g[q[r - 1]]) r--;
    q[r++] = x;
  }
  long long Max() { return g[q[l]]; }
} q;
signed main() {
  n = read(), k = read(), m = read();
  for (register long long i = 1; i <= n; i++) a[i] = read();
  if (m < n / k) {
    printf("-1\n");
    return 0;
  }
  memset(f, 128, sizeof(f));
  for (register long long i = 0; i <= k - 1; i++) f[i][0] = 0;
  for (register long long j = 1; j <= m; j++) {
    q.clear();
    q.push(0, f[0][j - 1]);
    for (register long long i = 1; i <= n; i++) {
      q.push(i, f[i - 1][j - 1] + a[i]);
      q.maintain(i);
      f[i][j] = q.Max();
    }
  }
  printf("%lld\n", f[n][m]);
  return 0;
}
