#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 5010;
const long long inf = (1ll << 60);
long long n, m, k, ans;
long long f[Maxn][Maxn];
long long a[Maxn];
inline long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int main() {
  n = read(), k = read(), m = read();
  for (long long i = 1; i <= n; ++i) a[i] = read();
  deque<long long> q;
  for (long long i = 0; i <= n; ++i)
    for (long long j = 0; j <= m; ++j) f[i][j] = -inf;
  f[0][0] = 0;
  for (long long j = 1; j <= m; ++j) {
    for (long long i = 0; i <= n; ++i) {
      while (q.size() && i - q.front() > k) q.pop_front();
      if (q.size()) f[i][j] = f[q.front()][j - 1] + a[i];
      while (q.size() && f[q.back()][j - 1] <= f[i][j - 1]) q.pop_back();
      q.push_back(i);
    }
    q.clear();
  }
  ans = -inf;
  for (long long i = n - k + 1; i <= n; ++i) ans = max(ans, f[i][m]);
  if (ans <= 0)
    puts("-1");
  else
    printf("%lld\n", ans);
  return 0;
}
