#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const ll INF = 2e18;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m, K;
    cin >> n >> m >> K;
    vector<ll> a(n);
    vector<ll> dp(n, -INF);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        dp[i] = a[i];
    }

    for (int i = 2; i <= K; i++) {
        vector<ll> ndp(n, -INF);
        deque<int> q;
        for (int j = 0; j < n; j++) {
            while (!q.empty()) {
                if (j - q.front() > m) q.pop_front();
                else break;
            }
            if (!q.empty()) {
                ndp[j] = dp[q.front()] + i * a[j];
            }

            while (!q.empty()) {
                if (dp[q.back()] <= dp[j]) q.pop_back();
                else break;
            }
            q.push_back(j);
        }
        dp = move(ndp);
    }
    
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        ans = max(ans, dp[i]);
    }
    cout << ans << endl;
    return 0;
}