#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e8;
deque<long long int> q;
int n, m, k;
long long int a[MAXN], last[MAXN], dp[MAXN];
void qpush(long long int num) {
  while (!q.empty() && q.back() < num) {
    q.pop_back();
  }
  q.push_back(num);
}
void qpop(long long int num) {
  if (num == q.front()) {
    q.pop_front();
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i]);
  }
  if (n / m > k) {
    printf("-1\n");
    return 0;
  }
  fill(last, last + 1 + n, LONG_LONG_MIN);
  last[0] = 0;
  fill(dp, dp + 1 + n, LONG_LONG_MIN);
  for (int i = 1; i <= k; ++i) {
    q.clear();
    for (int j = 0; j <= n; ++j) {
      if (j > m) {
        qpop(last[j - m - 1]);
      }
      if (j >= i) {
        dp[j] = max(dp[j], q.front() + a[j]);
      }
      qpush(last[j]);
    }
    for (int j = 0; j <= n; ++j) {
      last[j] = dp[j];
      dp[j] = LONG_LONG_MIN;
    }
  }
  long long int ans = 0;
  for (int i = n; i > n - m; --i) {
    ans = max(ans, last[i]);
  }
  printf("%I64d\n", ans);
  return 0;
}
