#include <bits/stdc++.h>
using namespace std;
class UnionFind {
 public:
  vector<int> rank;
  vector<pair<int, int> > p;
  UnionFind(int N) {
    rank.assign(N, 0);
    p.assign(N, pair<int, int>(0, 1));
    for (int i = 0; i < N; i++) p[i].first = i;
  }
  int findSet(int i) {
    return (p[i].first == i) ? i : (p[i].first = findSet(p[i].first));
  }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y]) {
        p[y].first = x;
        p[x].second += p[y].second;
      } else {
        p[x].first = y;
        p[y].second += p[x].second;
        if (rank[x] == rank[y]) rank[y]++;
      }
    }
  }
  int getMax() {
    int maxIn = 0;
    for (int i = 0; i < p.size(); i++)
      if (p[i].second > p[maxIn].second) maxIn = i;
    return maxIn;
  }
};
bool comp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long long dp[x + 1][n];
  for (int i = 0; i <= x; i++) dp[i][0] = arr[0];
  for (int i = 0; i < n; i++) dp[0][i] = 0;
  for (int i = 1; i <= x; i++)
    for (int j = 1; j < n; j++) {
      long long max = 0;
      for (int t = j - 1; t >= j - k && t >= 0; t--)
        if (dp[i - 1][t] > max) max = dp[i - 1][t];
      dp[i][j] = (max + arr[j]) * (max != 0);
      if (!max && j < k) dp[i][j] = arr[j];
    }
  long long res = 0;
  for (int i = n - 1; i >= n - k && i >= 0; i--)
    if (dp[x][i] > res) res = dp[x][i];
  cout << (res ? res : -1);
}
