#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 500;
long long dp[MAXN][MAXN];
const long long INF = 1e18;
signed main() {
  long long n, k, X;
  cin >> n >> k >> X;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < MAXN; i++)
    for (long long j = 0; j < MAXN; j++) dp[i][j] = -INF;
  dp[n][0] = 0;
  for (long long i = n - 1; i >= 0; i--) {
    for (long long x = 1; x <= min(n - i, X); x++) {
      for (long long j = i + 1; j <= i + k; j++) {
        dp[i][x] = max(dp[i][x], dp[j][x - 1] + a[i]);
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i < k; i++) {
    ans = max(ans, dp[i][X]);
  }
  if (ans == 0)
    cout << -1;
  else
    cout << ans;
  return 0;
}
