#include <bits/stdc++.h>
using namespace std;
long long get() {
  long long x = 0;
  char s = getchar();
  while (s < '0' || s > '9') s = getchar();
  while (s >= '0' && s <= '9')
    x = (x << 3) + (x << 1) + (s ^ 48), s = getchar();
  return x;
}
long long Max(const long long x, const long long y) {
  if (x > y) return x;
  return y;
}
const long long M = 5005;
long long n, k, m, a[M], dp[M][M];
deque<long long> q;
signed main() {
  n = get(), k = get(), m = get();
  for (long long i = 1; i <= n; ++i) a[i] = get();
  memset(dp, -0x3f, sizeof dp);
  dp[0][0] = 0;
  for (long long j = 1; j <= m; ++j) {
    q.clear();
    q.push_back(j - 1);
    for (long long i = j; i <= n; ++i) {
      while (!q.empty() && q.front() < i - k) q.pop_front();
      if (!q.empty()) dp[i][j] = dp[q.front()][j - 1] + a[i];
      while (!q.empty() && dp[i][j - 1] > dp[q.back()][j - 1]) q.pop_back();
      q.push_back(i);
    }
  }
  long long ans = -1;
  for (long long i = n - k + 1; i <= n; ++i) ans = Max(ans, dp[i][m]);
  printf("%lld", ans);
  return 0;
}
