#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
bool maximize(T &lhs, U rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}
template <class T, class U>
bool minimize(T &lhs, U rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}
template <class T>
T tabs(T x) {
  return (x < (T)0 ? -x : x);
}
namespace Task {
void solve() {
  int n, k, x;
  cin >> n >> k >> x;
  vector<int> a(n + 2);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  constexpr int64_t INF = 1e16;
  vector<vector<int64_t> > f(n + 2, vector<int64_t>(x + 2, -INF));
  int64_t ans = -1;
  for (int i = 1; i <= k; ++i) {
    f[i][1] = a[i];
  }
  for (int j = 1; j <= x; ++j) {
    deque<int> dque;
    for (int i = 1; i <= n; ++i) {
      if (!dque.empty()) {
        maximize(f[i][j], (int64_t)a[i] + f[dque.front()][j - 1]);
      }
      while (!dque.empty() and f[dque.back()][j - 1] <= f[i][j - 1]) {
        dque.pop_back();
      }
      while (!dque.empty() and dque.front() < i - k + 1) {
        dque.pop_front();
      }
      dque.emplace_back(i);
      if (j == x and i + k - 1 >= n) {
        maximize(ans, f[i][j]);
      }
    }
  }
  cout << ans << '\n';
  auto clearData = [&]() -> void {};
  clearData();
}
}  // namespace Task
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int nTest = 1;
  for (int _ = 1; _ <= nTest; ++_) {
    Task::solve();
  }
}
