#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using vi = vector<i64>;
using vvi = vector<vi>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, m, k;
    cin >> n >> m >> k;
    vi as(n);
    for (int i = 0; i < n; i++) {
        cin >> as[i];
    }

    vi dp(as);
    using ii = pair<i64, int>;
    for (int i = 0; i < k - 1; i++) {
        deque<ii> deq;
        vi dp2(n);
        for (int j = 0; j < n; j++) {
            // for (int d = 0; d < deq.size(); d++) {
            //     cout << "DEBUG " << deq[d].first << " " << deq[d].second << endl;
            // }

            if (j >= i + 1) {
                dp2[j] = (i + 2) * as[j] + deq.front().first;
            }

            if (deq.size() && deq.front().second <= j - m) {
                deq.pop_front();
            }
            while (deq.size()) {
                if (deq.back().first <= dp[j]) deq.pop_back();
                else break;
            }
            deq.push_back(ii(dp[j], j));
        }
        dp = vi(dp2);
    }
    i64 nax = -1;
    for (int i = 0; i < n; i++) {
        nax = max(nax, dp[i]);
    }
    cout << nax << endl;
}
