#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + (s - '0');
    s = getchar();
  }
  return x * f;
}
const int jzm = 1000000007;
int n, m, i, j, s, o, k;
int a[5005];
long long dp[5005][5005];
int q[5005][5005], tp[5005], tl[5005];
int main() {
  n = read();
  k = read();
  m = read();
  for (int i = 1; i <= n; i++) tl[i] = 1, dp[0][i] = -1e18;
  for (int i = 1; i <= n; i++) {
    if (i > k) dp[0][0] = -1e18;
    a[i] = read();
    for (int j = i; j > 0; j--) {
      dp[i][j] = dp[q[j - 1][tl[j - 1]]][j - 1] + (long long)a[i];
      while (tl[j] <= tp[j] && dp[q[j][tp[j]]][j] < dp[i][j]) {
        q[j][tp[j]--] = 0;
      }
      q[j][++tp[j]] = i;
      while (tl[j] <= tp[j] && q[j][tl[j]] <= i - k) q[j][tl[j]++] = 0;
    }
  }
  if (k * m + k - 1 < n) {
    printf("-1\n");
    return 0;
  }
  long long ans = 0;
  for (int i = n - k + 1; i <= n; i++) {
    ans = max(ans, dp[i][m]);
  }
  printf("%lld\n", ans);
  return 0;
}
