#include <bits/stdc++.h>
using namespace std;
const int maxn = 5005;
deque<pair<int, long long> > q[maxn];
long long a[maxn];
long long dp[maxn][maxn];
long long tmp[maxn];
long long n, k, x;
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%lld%lld%lld", &n, &k, &x);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  q[0].push_back(make_pair(0, 0));
  for (int i = 1; i <= n; i++) {
    memset(tmp, 0, sizeof(tmp));
    for (int j = 1; j <= x; j++) {
      while (!q[j - 1].empty() && q[j - 1].front().first < i - k)
        q[j - 1].pop_front();
      if (!q[j - 1].empty()) tmp[j] = q[j - 1].front().second + a[i];
    }
    for (int j = 1; j <= x; j++) {
      while (!q[j].empty() && q[j].back().second < tmp[j]) q[j].pop_back();
      if (tmp[j]) q[j].push_back(make_pair(i, tmp[j]));
    }
  }
  long long ans = -1;
  while (!q[x].empty() && q[x].front().first <= n - k) q[x].pop_front();
  if (!q[x].empty()) ans = q[x].front().second;
  cout << ans << "\n";
}
