#include <bits/stdc++.h>
using namespace std;
int q[10000];
long long dp[5010][5010], A[5010];
int main() {
  int i, n, m, k, j;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) scanf("%lld", &A[i]);
  for (i = 1; i <= m; i++) dp[i][1] = A[i];
  for (j = 2; j <= k; j++) {
    int l = 2, r = 1;
    for (i = 1; i <= n; i++) {
      while (l < r && i - m > q[l]) l++;
      if (l > r || dp[q[l]][j - 1] == 0)
        dp[i][j] = 0;
      else
        dp[i][j] = dp[q[l]][j - 1] + A[i];
      while (l <= r && dp[q[r]][j - 1] < dp[i][j - 1]) r--;
      q[++r] = i;
    }
  }
  long long ans = 0;
  for (i = n - m + 1; i <= n; i++)
    if (ans < dp[i][k]) ans = dp[i][k];
  if (ans == 0)
    printf("-1\n");
  else
    printf("%lld\n", ans);
  return 0;
}
