#include <bits/stdc++.h>
using namespace std;
struct RMQ_Tree {
  int n;
  long long mx[1 << 20];
  void init(int _n) {
    for (n = 1; n < _n; n <<= 1)
      ;
    for (int i = n << 1; --i;) mx[i] = -0x3f3f3f3f3f3f3f3fLL;
  }
  void insert(int p, long long val) {
    p += n - 1;
    for (; p && val > mx[p]; p >>= 1) mx[p] = val;
  }
  long long calc(int st, int ed) {
    if (st > ed) return -0x3f3f3f3f3f3f3f3fLL;
    st += n - 1;
    ed += n;
    long long ans = -0x3f3f3f3f3f3f3f3fLL;
    while (st < ed) {
      if (st & 1) ans = max(ans, mx[st++]);
      if (ed & 1) ans = max(ans, mx[ed ^ 1]);
      st >>= 1;
      ed >>= 1;
    }
    return ans;
  }
} Tree;
int a[5010];
int main() {
  int n, k, x;
  scanf("%d %d %d", &n, &k, &x);
  Tree.init(n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i <= k) Tree.insert(i, a[i]);
  }
  for (int j = 1; j < x; j++) {
    for (int i = n; i >= 1; i--) {
      Tree.insert(i, Tree.calc(max(1, i - k), i - 1) + a[i]);
    }
  }
  printf("%I64d\n", max(-1LL, Tree.calc(n - k + 1, n)));
}
