#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
void solve() {
  int n, k, x;
  cin >> n >> k >> x;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long dp[n + 1][x + 1];
  memset(dp, -0x3f, sizeof dp);
  dp[0][0] = 0;
  for (int j = 1; j <= x; j++) {
    deque<array<long long, 2>> dq;
    dq.push_back({j - 1, dp[j - 1][j - 1]});
    for (int i = j; i <= n; i++) {
      while (dq.size() && dq.front()[0] < i - k) dq.pop_front();
      dp[i][j] = dq.front()[1] + a[i];
      while (dq.size() && dp[i][j - 1] >= dq.back()[1]) dq.pop_back();
      dq.push_back({i, dp[i][j - 1]});
    }
  }
  long long ans = -1;
  for (int i = 0; i < k; i++) {
    ans = max(ans, dp[n - i][x]);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  for (int t = 1; t <= tc; t++) {
    solve();
  }
}
