#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = 1e9 + 7;
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T> v) {
  os << "(" << v.first << ", " << v.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T> v) {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i > 0) {
      os << " ";
    }
    os << v[i];
  }
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<vector<T>> v) {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i > 0) {
      os << endl;
    }
    os << v[i];
  }
  return os;
}
long long dp[5010][5010];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m, x;
  cin >> n >> m >> x;
  vector<long long> a(n);
  for (int i = 0; i < (int)n; ++i) cin >> a[i];
  const long long INF = (1ll << 60);
  for (int i = 0; i < (int)5010; ++i)
    for (int j = 0; j < (int)5010; ++j) dp[i][j] = -INF;
  dp[0][0] = 0;
  a.push_back(0);
  for (int j = 0; j < (int)5005; ++j) {
    if (j == 0) continue;
    deque<int> dq;
    long long mi = -INF;
    for (int i = 0; i < (int)n + 1; ++i) {
      while (!dq.empty() && dp[dq.back()][j - 1] <= dp[i][j - 1]) {
        dq.pop_back();
      }
      dq.push_back(i);
      mi = dp[dq.front()][j - 1];
      if (mi != -INF) dp[i + 1][j] = max(mi + a[i], dp[i + 1][j]);
      if (i >= m - 1) {
        if (dq.front() == i - m + 1) dq.pop_front();
      }
    }
  }
  cout << (dp[n + 1][x + 1] == -INF ? -1 : dp[n + 1][x + 1]) << endl;
  return 0;
}
