#include <cstdio>
#include <queue>
using namespace std;
int read()
{
int x=0,f=1;char c=getchar();
while (c<'0' || c>'9'){if (c=='-')f=-1;c=getchar();}
while (c>='0'&&c<='9'){x=(x<<1)+(x<<3)+c-48;c=getchar();}
return x*f;
}
const int MAXN=500005;
int n,x,y,ans=-99999999;
int a[MAXN],sum[MAXN];
deque<int> Q;
int main()
{
n=read();x=read();y=read();
for (int i=1;i<=n;i++) sum[i]=sum[i-1]+(a[i]=read());
for (int i=x;i<=n;i++)
{
while (!Q.empty()&&sum[i-x]<sum[Q.back()])Q.pop_back();
Q.push_back(i-x);
while (!Q.empty()&&i-Q.front()>y)Q.pop_front();
ans=max(ans,sum[i]-sum[Q.front()]);
}
printf("%d\n",ans);
return 0;
}