#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int n, K, X;
int a[5010];
long long f[5010][5010];
multiset<long long> s[5010];
int main() {
  scanf("%d%d%d", &n, &K, &X);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= X; j++)
      f[i][j] = -1LL * (long long)inf * (long long)inf;
  f[0][0] = 0;
  s[0].insert(0);
  for (int i = 1; i <= n; i++) {
    int j;
    for (j = min(i, X); j >= 1 && j >= X + i - n; j--)
      if (!s[j - 1].empty()) {
        auto iter = s[j - 1].end();
        iter--;
        f[i][j] = *iter + a[i];
        if (i >= K && f[i - K][j] >= 0) s[j].erase(s[j].find(f[i - K][j]));
        s[j].insert(f[i][j]);
      } else
        break;
    if (i >= K && f[i - K][j] >= 0) s[j].erase(s[j].find(f[i - K][j]));
  }
  long long ans = -1;
  for (int i = n - K + 1; i <= n; i++) ans = max(ans, f[i][X]);
  cout << ans << endl;
  return 0;
}
