import java.util.*; public class 第二点五个不高兴的小明 { static int n,p,t; static int[] fangge; static int[][] dp; //dp[i][j]=k 表示第i步走到第j个位置有权重值和为K public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan=new Scanner(System.in); n=scan.nextInt(); p=scan.nextInt(); t=scan.nextInt(); fangge=new int[n+2]; dp=new int[t+2][n+2]; for(int i=1;i<=n;i++) { fangge[i]=scan.nextInt(); } for(int i=1;i<=t;i++) { for(int j=0;j<=n;j++) { dp[i][j]=Integer.MIN_VALUE; } } for(int i=1;i<=p && i<=n;i++) { dp[1][i]=fangge[i]; } dp[0][0]=0; int step=2; while(step<t) { for(int index=step-1;index<=n;index++) { if(dp[step-1][index]==Integer.MIN_VALUE) continue; for(int i=1;i<=p;i++) { int newIndex=index+i; if(newIndex>n+1) continue; int temp=dp[step-1][index]+fangge[newIndex]; dp[step][newIndex]=Math.max(dp[step][newIndex], temp); } } step++; } int maxN=Integer.MIN_VALUE; for(int i=1;i<=n;i++) { if(dp[t-1][i]>maxN && i+p>=n+1) { maxN=dp[t-1][i]; } } System.out.println(maxN); } }