#include <iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
typedef long long int ll;
ll dp[5005][5005];
ll sum[5005];
int main() {
// your code goes here
ll n,m,k,i,j,size,ki;
cin>>n>>m>>ki;
size=m;
ll a[n+2];
if(m==1)
{
for(i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
if(ki==1){
cout<<a[n-1]<<endl;
return 0;
}
// sort(a,a+n);
ll s=0;
//a[0]=0;
//for(i=n;i>=n-ki+1;i--)
//cout<<a[i]<<" ";
for(i=n-1;i>=n-ki;i--)
s+=a[i];
cout<<s<<endl;
return 0;
}
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<size;i++)
sum[i]=a[i];
for(i=1;i<=size;i++)
{
sum[size]+=a[i];
}
// cout<<sum[2]<<" ";
for(i=size+1;i<=n;i++)
{
sum[i]+= sum[i-1]- a[i-size]+ a[i];
// cout<<sum[i]<<" ";
}
// cout<<endl;
for(i=0;i<=5002;i++)
{
for(j=0;j<=5002;j++)
dp[i][j]=0;
}
for(j=1;j<=n;j++)
dp[1][j]= max(sum[j], dp[1][j-1]);
for(k=2;k<=ki;k++)
{
for(j=1;j<=n;j++)
{
if(j-size>=size)
dp[k][j]= max(dp[k-1][j-size]+sum[j],dp[k][j-1]);
}
}
/*
for(i=1;i<=ki;i++)
{
for(j=1;j<=n;j++)
cout<<dp[i][j]<<" ";
cout<<endl;
}
*/
cout<<dp[ki][n]<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPHN0ZGlvLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBpbnQgbGw7CmxsIGRwWzUwMDVdWzUwMDVdOwpsbCBzdW1bNTAwNV07CgppbnQgbWFpbigpIHsKICAgIC8vIHlvdXIgY29kZSBnb2VzIGhlcmUKICAgIGxsIG4sbSxrLGksaixzaXplLGtpOwogICAgY2luPj5uPj5tPj5raTsKICAgIHNpemU9bTsKCiAgICBsbCBhW24rMl07CiAgICAgCiAgICAgaWYobT09MSkKICAgICB7CiAgICAgCWZvcihpPTA7aTxuO2krKykKICAgICAgICAgY2luPj5hW2ldOwogICAgICAgICAKICAgICAgICAgc29ydChhLGErbik7CiAgICAgICAgIGlmKGtpPT0xKXsKICAgICAgICAgY291dDw8YVtuLTFdPDxlbmRsOwogICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICAgICAvLyBzb3J0KGEsYStuKTsKICAgICAgICBsbCBzPTA7CiAgICAgICAgLy9hWzBdPTA7CiAgICAgICAgLy9mb3IoaT1uO2k+PW4ta2krMTtpLS0pCiAgICAgICAgIC8vY291dDw8YVtpXTw8IiAiOwogICAgICAgICAKICAgICAgICBmb3IoaT1uLTE7aT49bi1raTtpLS0pCiAgICAgICAgIHMrPWFbaV07CiAgICAgICAgIAogICAgICAgICBjb3V0PDxzPDxlbmRsOwogICAgICAgICByZXR1cm4gMDsKICAgICB9CiAgICAgCiAgICAgZm9yKGk9MTtpPD1uO2krKykKICAgICBjaW4+PmFbaV07CiAgCiAgICAgZm9yKGk9MTtpPHNpemU7aSsrKQogICAgICBzdW1baV09YVtpXTsKICAgICAgCiAgICAgZm9yKGk9MTtpPD1zaXplO2krKykKICAgICAgewogICAgICAJc3VtW3NpemVdKz1hW2ldOwogICAgICB9CiAgICAgIAogICAgLy8gIGNvdXQ8PHN1bVsyXTw8IiAiOwogICAgICAKICAgIGZvcihpPXNpemUrMTtpPD1uO2krKykKICAgIHsKICAgICAgICBzdW1baV0rPSBzdW1baS0xXS0gYVtpLXNpemVdKyBhW2ldOwogICAgIC8vIGNvdXQ8PHN1bVtpXTw8IiAiOwogICAgfQogICAvLyBjb3V0PDxlbmRsOwogICAgCiAgICBmb3IoaT0wO2k8PTUwMDI7aSsrKQogICAgewogICAgICAgIGZvcihqPTA7ajw9NTAwMjtqKyspCiAgICAgICAgIGRwW2ldW2pdPTA7CiAgICB9CiAgICAKICAgIGZvcihqPTE7ajw9bjtqKyspCiAgICAgZHBbMV1bal09IG1heChzdW1bal0sIGRwWzFdW2otMV0pOwogICAgCiAgICBmb3Ioaz0yO2s8PWtpO2srKykKICAgIHsKICAgICAgICBmb3Ioaj0xO2o8PW47aisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoai1zaXplPj1zaXplKQogICAgICAgICAgICBkcFtrXVtqXT0gbWF4KGRwW2stMV1bai1zaXplXStzdW1bal0sZHBba11bai0xXSk7CiAgICAgICAgfQogICAgfQogICAgLyoKICAgIGZvcihpPTE7aTw9a2k7aSsrKQogICAgewogICAgICAgIGZvcihqPTE7ajw9bjtqKyspCiAgICAgICAgIGNvdXQ8PGRwW2ldW2pdPDwiICI7CiAgICAgICAgIGNvdXQ8PGVuZGw7CiAgICB9CiAgICAqLwogICAgY291dDw8ZHBba2ldW25dPDxlbmRsOwogICAgcmV0dXJuIDA7Cn0=