#include <bits/stdc++.h>
namespace shl {
inline int read() {
  int ret = 0, op = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') op = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return ret * op;
}
const int N = 5010;
int n, m, k;
int a[N];
long long que[N], head, tail, f[N][N];
int main() {
  n = read(), k = read(), m = read();
  for (register int i = 1; i <= n; ++i) a[i] = read();
  for (register int i = 0; i <= n; ++i)
    for (register int j = 0; j <= m; ++j) f[i][j] = -(1ll << 63);
  f[0][0] = 0;
  for (register int j = 1; j <= m; ++j) {
    head = 1, tail = 1;
    que[1] = 0;
    for (register int i = 1; i <= n; ++i) {
      while (head <= tail && que[head] < i - k) head++;
      f[i][j] = f[que[head]][j - 1] + a[i];
      while (head <= tail && f[que[tail]][j - 1] <= f[i][j - 1]) tail--;
      que[++tail] = i;
    }
  }
  long long ans = -(1ll << 63);
  for (register int i = n - k + 1; i <= n; ++i) ans = std::max(ans, f[i][m]);
  if (ans < 0)
    puts("-1");
  else
    printf("%lld\n", ans);
  return 0;
}
}  // namespace shl
int main() {
  shl::main();
  return 0;
}
