#include <bits/stdc++.h>
using namespace std;
const long long minval = INT_MIN * (1LL << 25);
long long n, k, x, dp[5005][5005], a[5005];
long long calc(long long pos, long long left) {
  if (pos >= n) return 0;
  if ((n - pos - 1) >= left * k || left > n - pos) return minval;
  if (dp[pos][left] != -1) return dp[pos][left];
  dp[pos][left] = a[pos];
  long long mx = minval;
  for (int i = 0; i < k; i++) mx = max(mx, calc(pos + i + 1, left - 1));
  dp[pos][left] += mx;
  return dp[pos][left];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  memset(dp, -1, sizeof dp);
  cin >> n >> k >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = minval;
  for (int i = 0; i < k; i++) ans = max(ans, calc(i, x));
  if (ans < 0)
    cout << -1;
  else
    cout << ans;
  return 0;
}
