#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;
const int N = 5e3 + 10;
int n, k, x;
long long ans;
int a[N];
long long dp[N][N], sum;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
struct node {
  int l, r, lc, rc, mid;
  long long maxn;
} t[N * 4];
long long Max(long long x, long long y) {
  if (x > y) return x;
  return y;
}
void build(int p, int l, int r) {
  t[p].l = l;
  t[p].r = r;
  t[p].maxn = -0x3f3f3f3f3f3f3f3f;
  if (l == r) return;
  t[p].lc = p * 2;
  t[p].rc = p * 2 + 1;
  t[p].mid = (l + r) / 2;
  build(t[p].lc, l, t[p].mid);
  build(t[p].rc, t[p].mid + 1, r);
}
void modify(int p, int pos, long long d) {
  if (t[p].l == t[p].r) {
    t[p].maxn = d;
    return;
  }
  if (pos <= t[p].mid)
    modify(t[p].lc, pos, d);
  else
    modify(t[p].rc, pos, d);
  t[p].maxn = Max(t[t[p].lc].maxn, t[t[p].rc].maxn);
}
long long query(int p, int l, int r) {
  if (t[p].l >= l && t[p].r <= r) return t[p].maxn;
  long long maxn = -0x3f3f3f3f3f3f3f3f;
  if (l <= t[p].mid) maxn = query(t[p].lc, l, r);
  if (r > t[p].mid) maxn = Max(maxn, query(t[p].rc, l, r));
  return maxn;
}
int main() {
  n = read();
  k = read();
  x = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  if (n / k > x) {
    cout << -1;
    return 0;
  }
  if (n == x) {
    for (int i = 1; i <= n; i++) sum += a[i];
    printf("%lld", sum);
    return 0;
  }
  build(1, 0, n);
  modify(1, 0, 0);
  for (int i = 1; i <= x; i++) {
    for (int j = i; j <= n; j++)
      dp[i][j] = query(1, Max(0ll, j - k), j - 1) + a[j];
    for (int j = i; j <= n; j++)
      if (dp[i][j] != dp[i - 1][j]) modify(1, j, dp[i][j]);
    if (i == 1) modify(1, 0, -0x3f3f3f3f3f3f3f3f);
  }
  ans = query(1, n - k + 1, n);
  printf("%lld", ans);
  return 0;
}
