#include <bits/stdc++.h>
const int N = 5e3 + 10;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
using namespace std;
deque<pair<long long, int> > q[N];
int a[N];
int main() {
  int n, k, x;
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  if (n / k > x) return cout << -1, 0;
  long long ans = -1;
  for (int i = 1; i <= n; ++i) {
    int up = min(i - 1, x - 1), down = (i - 1) / k;
    for (int j = up; j >= down; --j) {
      while (!q[j].empty() && q[j].front().second < i - k) q[j].pop_front();
      long long now = a[i];
      if (!q[j].empty()) now += q[j].front().first;
      while (!q[j + 1].empty() && q[j + 1].back().first <= now)
        q[j + 1].pop_back();
      q[j + 1].push_back({now, i});
      if (j + 1 == x) {
        if (i >= n - k + 1) ans = max(ans, now);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
