#include <bits/stdc++.h>
using namespace std;
mt19937 rng(
    (unsigned int)chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
const int N = 5001;
int a[N];
ll t[2 * N];
ll d[N][N];
void build(int n) {
  for (int i = n - 1; i > 0; i--) t[i] = max(t[i << 1], t[i << 1 | 1]);
}
ll get(int n, int lf, int rf) {
  ll res = 0;
  for (lf += n, rf += n; lf < rf; lf >>= 1, rf >>= 1) {
    if (lf & 1) res = max(res, t[lf++]);
    if (rf & 1) res = max(res, t[--rf]);
  }
  return res;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  int n, k, x;
  cin >> n >> k >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < k; i++) d[1][i] = a[i];
  for (int i = 2; i <= x; i++) {
    for (int j = 0; j < n; j++) t[j + n] = d[i - 1][j];
    build(n);
    for (int j = i - 1; j < n; j++) {
      ll mx = get(n, max(j - k, 0), j);
      if (mx > 0) d[i][j] = mx + a[j];
    }
  }
  ll mx = 0;
  for (int i = max(n - k, 0); i < n; i++) {
    mx = max(mx, d[x][i]);
  }
  if (mx > 0)
    cout << mx << endl;
  else
    cout << -1 << endl;
}
