#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const long long N = 5010;
long long n, m, k, ans, a[N], f[2][N], q[N], head, tail;
signed main() {
  n = read();
  k = read();
  m = read();
  for (long long i = 1; i <= n; ++i) a[i] = read();
  memset(f[0], ~0x3f, sizeof(f[0]));
  f[0][0] = 0;
  for (long long i = 1; i <= m; ++i) {
    head = tail = 1;
    q[1] = 0;
    long long w = i & 1;
    for (long long j = 1; j <= n; ++j) {
      while (head <= tail && j - q[head] > k) ++head;
      f[w][j] = f[w ^ 1][q[head]] + a[j];
      while (head <= tail && f[w ^ 1][q[tail]] <= f[w ^ 1][j]) --tail;
      q[++tail] = j;
    }
  }
  long long ans = -0x7f7f7f7f7f7f7f7f;
  for (long long i = n - k + 1; i <= n; ++i) ans = max(ans, f[m & 1][i]);
  return printf("%lld\n", ans < 0 ? -1 : ans) & 0;
}
