#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
long long n, k, x;
long long arr[6005];
long long dp[6005][6005];
int main() {
  cin >> n >> k >> x;
  long long i, j;
  for (i = 1; i <= n; i++) cin >> arr[i];
  memset(dp, -1, sizeof(dp));
  for (i = 0; i < 6005; i++) dp[i][0] = 0;
  for (long long rem = 1; rem <= x; rem++) {
    deque<long long> dq;
    dq.push_back(0);
    for (long long idx = 1; idx <= n; idx++) {
      if (dq.front() < idx - k) dq.pop_front();
      if (dp[rem - 1][dq.front()] != -1)
        dp[rem][idx] = dp[rem - 1][dq.front()] + arr[idx];
      while (!dq.empty() && dp[rem - 1][dq.back()] <= dp[rem - 1][idx])
        dq.pop_back();
      dq.push_back(idx);
    }
  }
  long long ans = -1;
  for (long long idx = n; idx >= n - k + 1; idx--) ans = max(ans, dp[x][idx]);
  cout << ans << endl;
  return 0;
}
