#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
void setIO(string name, int submit) {
  if (submit) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  } else {
  }
}
long long dp[205][205];
int main() {
  setIO("", 0);
  int N, K, X;
  cin >> N >> K >> X;
  vector<int> arr;
  arr.push_back(0);
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    arr.push_back(num);
  }
  for (int l = 1; l <= N; l++) {
    for (int j = 0; j <= X; j++) {
      dp[l][j] = -1;
    }
  }
  vector<deque<pair<long long, long long>>> window(X + 1);
  window[0].emplace_back(0, 0);
  for (int i = 1; i <= N; i++) {
    for (int j = X; j >= 0; j--) {
      if (j > 0) {
        long long temp = -1;
        if (window[j - 1].size() > 0) temp = window[j - 1].back().first;
        if (temp == -1)
          dp[i][j] = -1;
        else
          dp[i][j] = temp + arr[i];
      }
      deque<pair<long long, long long>> &cur = window[j];
      while (cur.size() > 0 && cur.front().first < dp[i][j]) {
        cur.pop_front();
      }
      while (cur.size() > 0 && cur.back().second <= i - K) {
        cur.pop_back();
      }
      cur.emplace_front(dp[i][j], i);
    }
  }
  long long ans = -1;
  for (int k = K - 1; k >= 0; k--) {
    if (N - k >= 0) ans = max(dp[N - k][X], ans);
  }
  cout << ans << "\n";
  return 0;
}
