#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
int N, Min, Max;
int MAX = -999999999 + 5;
int Q[500050];
int sum[500050];
void init_file()
{
freopen("max.in", "r", stdin);
freopen("max.out", "w", stdout);
}
void read_data()
{
scanf("%d%d%d", &N, &Min, &Max);
for(int i = 1; i <= N; i++)
{
int x;
scanf("%d", &x);
sum[i] = sum[i - 1] + x;
}
}
void work()
{
int l = 1;
int r = 0;
r ++;
Q[r] = 0;
int ans = -0x3f3f3f3f;
for(int i = Min; i <= N; i++)
{
while(l<=r && i - Q[l] > Max) l++;
while(l<=r && sum[Q[r]]>=sum[i-Min]) r--;
Q[++r] = i-Min;
ans = max(ans,sum[i]-sum[Q[l]]);
}
printf("%d",ans);
}
int main()
{
read_data();
work();
return 0;
}