#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
const long long N = 5e3 + 5;
const long long mod = 998244353;
const long long INF = 1e18;
const int INFi = 0x7f7f7f7f;
long long test = 1, n, k, x, a[N], dp[N][N];
void solve() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[0][0] = 0;
  for (int i = 1; i <= x; i++) {
    set<pair<long long, long long>, greater<pair<long long, long long>>> second;
    second.insert({dp[i - 1][i - 1], i - 1});
    for (int j = i; j <= n; j++) {
      if (j >= i + k) second.erase({dp[i - 1][j - k - 1], j - k - 1});
      pair<long long, long long> p = *second.begin();
      if (p.first == -1) break;
      dp[i][j] = p.first + a[j];
      second.insert({dp[i - 1][j], j});
    }
  }
  long long ans = -1;
  for (int i = n; i > n - k; i--) {
    ans = max(ans, dp[x][i]);
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  for (int i = 1; i <= test; i++) {
    solve();
  }
}
