#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > t;
vector<vector<long long> > dp;
void build(long long v, long long l, long long r, long long ind) {
  if (l == r) {
    t[ind][v] = dp[l][ind];
    return;
  }
  long long m = (l + r) / 2;
  build(v * 2 + 1, l, m, ind);
  build(v * 2 + 2, m + 1, r, ind);
  t[ind][v] = max(t[ind][v * 2 + 1], t[ind][v * 2 + 2]);
}
long long sum(long long v, long long l, long long r, long long tl, long long tr,
              long long ind) {
  if (l > r) return -2e9;
  if (l == tl && r == tr) {
    return t[ind][v];
  }
  long long tm = (tl + tr) / 2;
  return max(sum(v * 2 + 1, l, min(tm, r), tl, tm, ind),
             sum(v * 2 + 2, max(tm + 1, l), r, tm + 1, tr, ind));
}
void update(long long v, long long l, long long r, long long pos,
            long long ind) {
  if (l == r) {
    t[ind][v] = dp[pos][ind];
    return;
  }
  long long m = (l + r) / 2;
  if (pos <= m) {
    update(v * 2 + 1, l, m, pos, ind);
  } else {
    update(v * 2 + 2, m + 1, r, pos, ind);
  }
  t[ind][v] = max(t[ind][v * 2 + 1], t[ind][v * 2 + 2]);
}
int main() {
  long long n, k, x;
  cin >> n >> k >> x;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  t.resize(x + 1, vector<long long>(25010));
  dp.resize(n, vector<long long>(x + 1, -2e9));
  for (long long i = 0; i < k; i++) dp[i][1] = a[i];
  for (long long i = 0; i < x + 1; i++) {
    build(0, 0, n - 1, i);
  }
  for (long long i = 1; i < n; i++) {
    for (long long j = 1; j < x + 1; j++) {
      long long getMax = sum(0, max(0LL, i - k), i - 1, 0, n - 1, j - 1);
      if (getMax == -2e9) continue;
      dp[i][j] = max(dp[i][j], getMax + a[i]);
      update(0, 0, n - 1, i, j);
    }
  }
  long long ans = -2e9;
  for (long long i = n - k; i < n; i++) {
    ans = max(ans, dp[i][x]);
  }
  if (ans == -2e9) return cout << -1, 0;
  cout << ans;
  return 0;
}
