#include <bits/stdc++.h>
using namespace std;
const int MXN = 5e3 + 5;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int n, k, x;
int a[MXN];
long long dp[MXN][MXN], ar[MXN][14];
void sparse_table(int m) {
  for (int i = 1; i <= n; ++i) ar[i][0] = dp[i][m];
  for (int j = 1; j < 14; ++j) {
    for (int i = 1; i + (1 << j) - 1 <= n; ++i) {
      ar[i][j] = max(ar[i][j - 1], ar[i + (1 << (j - 1))][j - 1]);
    }
  }
}
long long st_get(int a, int b) {
  int k = log(b - a + 1.0) / log(2.0);
  return max(ar[a][k], ar[b - (1 << k) + 1][k]);
}
int main() {
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  if (n / k > x) {
    printf("-1\n");
    return 0;
  }
  memset(dp, 0x80, sizeof(dp));
  for (int i = 1; i <= k; ++i) dp[i][1] = a[i];
  for (int j = 2; j <= x; ++j) {
    sparse_table(j - 1);
    for (int i = j; i <= n; ++i) {
      int tt = max(i - k, 1);
      dp[i][j] = a[i] + st_get(tt, i - 1);
    }
  }
  int tt = max(n - k + 1, x);
  for (int i = tt; i <= n; ++i) {
    dp[0][0] = max(dp[0][0], dp[i][x]);
  }
  printf("%lld\n", dp[0][0]);
  return 0;
}
