#include <bits/stdc++.h>
const long long INF = 1e18L + 1;
const int IINF = 1e9 + 1;
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
const long long lim = 1ll << 13;
struct seg {
  vector<long long> tab;
  seg() : tab(2 * lim, -1ll) {}
  void ins(long long pos, long long val) {
    pos += lim;
    tab[pos] = val;
    pos >>= 1;
    while (pos >= 1) {
      tab[pos] = max(tab[pos << 1], tab[(pos << 1) + 1]);
      pos >>= 1;
    }
  }
  long long mx(long long st, long long fn) {
    st += lim;
    fn += lim;
    long long res = max(tab[st], tab[fn]);
    while (fn - st > 1) {
      if ((st & 1) == 0) {
        res = max(res, tab[st + 1]);
      }
      if ((fn & 1) == 1) {
        res = max(res, tab[fn - 1]);
      }
      st >>= 1;
      fn >>= 1;
    }
    return res;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, x;
  cin >> n >> k >> x;
  seg prv, cur;
  vector<long long> a(n);
  for (long long i = (long long)0; i < (long long)n; i++) {
    cin >> a[i];
    if (i < k) {
      cur.ins(i, a[i]);
    }
  }
  for (long long j = (long long)2; j < (long long)x + 1; j++) {
    swap(cur, prv);
    for (long long i = (long long)j - 1; i < (long long)n; i++) {
      auto prf = prv.mx(max(i - k, 0ll), i - 1);
      if (prf != -1) {
        cur.ins(i, prf + a[i]);
      }
    }
  }
  cout << cur.mx(max(n - k, 0ll), n - 1) << "\n";
  return 0;
}
