#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

class SlideRangeQuery {
 public:
  using Compare = function<bool(int, int)>;

 private:
  Compare comp;
  deque<int> deq;
  int x = 0;

 public:
  SlideRangeQuery(const Compare& comp_) : comp(comp_) {}

  // [a, b)
  int query(int a, int b) {
    while (!deq.empty() && deq.front() < a) {
      deq.pop_front();
    }
    for (x = max(a, x); x < b; x++) {
      while (!deq.empty() && not comp(deq.back(), x)) {
        deq.pop_back();
      }
      deq.push_back(x);
    }
    return deq.empty() ? -1 : deq.front();
  }
};

int main() {
  int M, N, K;
  while (cin >> N >> M >> K) {
    vector<ll> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    vector<ll> dp = A;
    for (int i = 2; i <= K; i++) {
      vector<ll> ndp(N);
      SlideRangeQuery sq([&](int a, int b) { return dp[a] > dp[b]; });
      for (int j = i - 1; j < N; j++) {
        ndp[j] = i * A[j] + dp[sq.query(j - M, j)];
      }
      dp = ndp;
    }
    ll res = *max_element(dp.begin(), dp.end());
    cout << res << endl;
  }
  return 0;
}
