#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 2;
int n, k, x, a[N], lg[N];
long long dp[N][N], table[15][N];
void build(int x) {
  for (int i = 0; i <= lg[n]; i++) {
    if (i == 0) {
      for (int j = 1; j <= n; j++) table[i][j] = dp[x][j - 1];
    } else {
      int curlen = (1 << (i - 1));
      for (int j = 1; j <= n; j++) {
        table[i][j] = max(table[i - 1][j], table[i - 1][min(j + curlen, n)]);
      }
    }
  }
}
long long get(int l, int r) {
  int curlog = lg[r - l + 1];
  return max(table[curlog][l], table[curlog][r - (1 << curlog) + 1]);
}
int main() {
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) dp[i][j] = -1e18;
  dp[0][0] = 0;
  for (int i = 2; i <= n; i++) lg[i] = lg[i / 2] + 1;
  for (int i = 1; i <= x; i++) {
    build(i - 1);
    for (int j = i; j <= n; j++) {
      int id = max(j - k + 1, 1);
      dp[i][j] = get(id, j) + a[j];
    }
  }
  long long ans = -1e18;
  for (int i = n; i > n - k; i--) ans = max(ans, dp[x][i]);
  cout << max(ans, -1ll) << endl;
}
