#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7fffffff;
const double eps = 1e-10;
const double pi = acos(-1.0);
inline int read() {
  int x = 0, f = 1;
  char ch;
  ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch & 15);
    ch = getchar();
  }
  if (f)
    return x;
  else
    return -x;
}
const int N = 210;
int n, K, x;
int a[N], q[N], p[N], Q[N][N];
long long f[N][N];
int main() {
  n = read();
  K = read();
  x = read();
  if (n > K * x + K - 1) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 0; i <= x; i++) q[i] = 1;
  p[0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = x; j; j--) {
      int t = j - 1;
      while (q[t] <= p[t] && i - Q[t][q[t]] > K) ++q[t];
      if (q[t] <= p[t]) {
        f[i][j] = f[Q[t][q[t]]][t] + a[i];
        while (q[j] <= p[j] && f[i][j] >= f[Q[j][p[j]]][j]) --p[j];
        Q[j][++p[j]] = i;
      }
    }
  long long ans = 0;
  for (int i = n - K + 1; i <= n; ++i) ans = max(ans, f[i][x]);
  cout << ans << endl;
  return 0;
}
