#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
inline int getint() {
  char c = getchar();
  int x = 0, mi = 1;
  while (c != EOF && c != '-' && !isdigit(c)) c = getchar();
  if (c == '-') {
    mi = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * mi;
}
inline long long getll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline long double getdb() {
  static double x;
  scanf("%lf", &x);
  return x;
}
void sc(char* x) { scanf("%s", x); }
void sc(int& x) { scanf("%d", &x); }
void sc(long long& x) { scanf("%lld", &x); }
void sc(double& x) { scanf("%lf", &x); }
template <typename T, typename... Args>
void sc(T& v, Args&... args) {
  sc(v);
  sc(args...);
}
void pr(const char* const& s) { printf("%s", s); }
void pr(char* const& s) { printf("%s", s); }
void pr(char const& x) { printf("%c", x); }
void pr(bool const& x) { printf("%d", x); }
void pr(int const& x) { printf("%d", x); }
void pr(long long const& x) { printf("%lld", x); }
void pr(double const& x) { printf("%.12f", x); }
void pr(long double const& x) { printf("%.12f", (double)x); }
template <typename T, typename... Args>
void pr(T const& v, Args const&... args) {
  pr(v);
  pr(' ');
  pr(args...);
}
template <typename... Args>
void prln(Args const&... args) {
  pr(args...);
  pr("\n");
}
time_point<system_clock> timing;
void TBegin() { timing = system_clock::now(); }
double TEnd(const char* c = "time: ") {
  auto end = system_clock::now();
  auto d = duration_cast<microseconds>(end - timing);
  auto dt =
      double(d.count()) * microseconds::period::num / microseconds::period::den;
  printf("%s%.10f", c, dt);
  return dt;
}
void TTick(const char* c = "time:") {
  TEnd(c);
  TBegin();
}
void Fin() { freopen("in.txt", "r", stdin); }
template <typename T>
void updmax(
    T& a, T const& b, function<void(void)> f = [] {}) {
  if (a < b) {
    a = b;
    f();
  }
}
template <typename T>
void updmin(
    T& a, T const& b, function<void(void)> f = [] {}) {
  if (b < a) {
    a = b;
    f();
  }
}
template <typename T>
void fill(T a[], T v, int len) {
  for (decltype(0) i = 0, lim__lim = (len); i <= lim__lim; i++) a[i] = v;
}
template <typename T>
int descr(T* from, T* to) {
  sort(from, to);
  return (int)(unique(from, to) - from);
}
template <typename T>
int lbound(T* from, T* to, T const& val) {
  return (int)(lower_bound(from, to, val) - from);
}
template <typename T>
int ubound(T* from, T* to, T const& val) {
  return (int)(upper_bound(from, to, val) - from);
}
template <typename T>
void rmif(vector<T>& v, function<bool(int)> cond) {
  v.erase(remove_if(v.begin(), v.end(), cond), v.end());
}
template <typename T>
void rmif(set<T>& v, function<bool(int)> cond) {
  for (auto x = v.begin(); x != v.end();) {
    if (cond(x))
      v.erase(x++);
    else
      ++x;
  }
}
const int mxn = 5050;
const long long INF = 1e15;
long long v[mxn], d[mxn][mxn];
struct px {
  int loc;
  long long v;
};
int main() {
  int n, k, c;
  sc(n, k, c);
  ;
  for (decltype(1) i = 1, lim__lim = (n); i <= lim__lim; i++) v[i] = getint();
  for (decltype(0) t = 0, lim__lim = (c); t <= lim__lim; t++)
    for (decltype(0) i = 0, lim__lim = (n); i <= lim__lim; i++) d[t][i] = -INF;
  d[0][0] = 0;
  for (decltype(1) t = 1, lim__lim = (c); t <= lim__lim; t++) {
    deque<px> q;
    auto Push = [&](long long v, int loc) {
      while (!q.empty() && q.back().v <= v) q.pop_back();
      q.push_back(px{loc, v});
    };
    auto Pop = [&](int loc) {
      while (!q.empty() && q.front().loc < loc) q.pop_front();
    };
    auto Max = [&]() { return q.front().v; };
    for (decltype(1) i = 1, lim__lim = (n); i <= lim__lim; i++) {
      Push(d[t - 1][i - 1], i - 1);
      Pop(i - k);
      updmax(d[t][i], Max() + v[i]);
    }
  }
  long long ans = -1;
  for (decltype(n - k + 1) i = n - k + 1, lim__lim = (n); i <= lim__lim; i++)
    updmax(ans, d[c][i]);
  prln(ans < 0 ? -1 : ans);
  return 0;
}
