#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return (b ? __gcd(a, b) : a);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class T>
ostream &operator<<(ostream &os, set<T> S) {
  os << "{ ";
  for (auto s : S) os << s << " ";
  return os << "}";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class L, class R>
ostream &operator<<(ostream &os, map<L, R> M) {
  os << "{ ";
  for (auto m : M) os << "(" << m.first << ":" << m.second << ") ";
  return os << "}";
}
const int N = 5005;
const long long infi = 1e18;
struct Segtree {
  const int M = N * 2 * 20;
  vector<long long> tree;
  int n;
  Segtree(size_t szi, vector<long long> &v) {
    n = int(szi);
    tree.resize(4 * n);
    build(1, 1, n, v);
  }
  void build(int node, int l, int r, vector<long long> &v) {
    if (l == r) {
      tree[node] = v[l];
      return;
    }
    build(2 * node, l, (l + r) / 2, v);
    build(2 * node + 1, (l + r) / 2 + 1, r, v);
    tree[node] = max(tree[2 * node], tree[2 * node + 1]);
  }
  long long query(int l, int r, int node, int from, int to) {
    if (from == l and r == to) return tree[node];
    if ((l + r) / 2 + 1 > to) {
      return query(l, (l + r) / 2, 2 * node, from, to);
    } else if (from > (l + r) / 2) {
      return query((l + r) / 2 + 1, r, 2 * node + 1, from, to);
    } else {
      long long zz =
          max(query(l, (l + r) / 2, 2 * node, from, min((l + r) / 2, to)),
              query((l + r) / 2 + 1, r, 2 * node + 1,
                    max(from, (l + r) / 2 + 1), to));
      return zz;
    }
  }
  long long Query(int L, int R) { return query(1, n, 1, L, R); }
};
const int L = 200;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  int k, x;
  cin >> k >> x;
  vector<long long> ar(n + 1);
  for (int i = 1; i <= n; ++i) cin >> ar[i];
  vector<vector<long long>> dp(x + 1, vector<long long>(n + 1, -1));
  for (int i = 1; i <= k; ++i) dp[1][i] = ar[i];
  for (int i = 2; i <= x; ++i) {
    Segtree tr(n, dp[i - 1]);
    for (int j = i; j <= n; ++j) {
      long long wait = max(1, j - k);
      long long zzz = tr.Query(wait, j - 1);
      if (zzz > -1) dp[i][j] = zzz + ar[j];
    }
  }
  long long ans = -1;
  for (int i = n; i > n - k; --i) {
    ans = max(ans, dp[x][i]);
  }
  cout << ans << '\n';
  return 0;
}
