#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int read(T& x) {
  x = 0;
  char c = getchar(), f = 1;
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    if (c == -1) return -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  x *= f;
  return 1;
}
template <typename T, typename... Args>
inline int read(T& x, Args&... args) {
  return read(x) + read(args...);
}
template <typename T>
inline int write(T x) {
  if (x < 0) return putchar('-') & write((~x) + 1);
  if (x / 10) return write(x / 10) & putchar(x % 10 | 48);
  return putchar(x | 48);
}
template <typename T>
inline int write(T x, char c) {
  return write(x) + putchar(c);
}
long long n, m, k;
long long dp[5005][5005];
long long a[5005];
deque<int> dq;
signed main() {
  read(n, k, m);
  for (int i = 1; i <= n; i++) read(a[i]);
  memset(dp, -0x3f, sizeof dp);
  dp[0][0] = 0;
  for (int i = 1; i <= m; i++) {
    dq.clear();
    dq.push_back(0);
    for (int j = 1; j <= n; j++) {
      while (!dq.empty() && j - dq.front() > k) dq.pop_front();
      if (!dq.empty()) dp[i][j] = dp[i - 1][dq.front()] + a[j];
      while (!dq.empty() && dp[i - 1][dq.back()] < dp[i - 1][j]) dq.pop_back();
      dq.push_back(j);
    }
  }
  long long ans = -1;
  for (int i = n - k + 1; i <= n; i++)
    ans = ((ans) > (dp[m][i]) ? (ans) : (dp[m][i]));
  write(ans, '\n');
}
