#include <bits/stdc++.h>
using namespace std;
const long long siz = 5005;
long long n, k, x, dp[siz][siz];
vector<long long> a(siz);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> x;
  for (long long i = 1; i < n + 1; ++i) cin >> a[i];
  for (long long i = 0; i < siz; ++i)
    for (long long j = 0; j < siz; ++j) dp[i][j] = -1e18;
  for (long long i = 1; i < k + 1; ++i) {
    dp[i][1] = a[i];
  }
  for (long long i = 2; i < x + 1; ++i) {
    for (long long j = 1; j < n + 1; ++j) {
      for (long long p = 1; p < k + 1; ++p) {
        dp[p + j][i] = max(dp[p + j][i], dp[j][i - 1] + a[p + j]);
      }
    }
  }
  long long ans = -1e18;
  for (long long i = n - k + 1; i < n + 1; ++i) {
    ans = max(ans, dp[i][x]);
  }
  ans = max(ans, -1LL);
  cout << ans << "\n";
  return 0;
}
