#include<bits/stdc++.h>
using namespace std;

using ll=long long;
int main(){
    int n,m,k;
    cin>>n>>m>>k;
    vector<ll> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    vector<vector<ll>> dp(k+1,vector<ll>(n+1,0));
    for(int i=0;i<k;i++){
        deque<ll> deq;
        deque<int> ids;
        deq.push_back(dp[i][i]);
        ids.push_back(i);
        for(int j=i+1;j<=n;j++){
            while(m<j-ids.front()){
                deq.pop_front();
                ids.pop_front();
            }
            dp[i+1][j]=deq.front()+(i+1)*a[j-1];
            while(!deq.empty()){
                if(deq.back()<dp[i][j]) deq.pop_back(),ids.pop_back();
                else break;
            }
            deq.push_back(dp[i][j]);
            ids.push_back(j);
        }
    }    

    cout<<*max_element(dp[k].begin(),dp[k].end())<<endl;
    return 0;
}