// Arup Guha
// 9/20/2012
// Solution to 2009 MCPC Problem I: RIPOFF

import java.util.*;

public class i {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();

		// Go through all cases.
		while (n != 0) {

			int s = stdin.nextInt();
			int t = stdin.nextInt();

			// Set up DP array.
			Integer[][] dp = new Integer[t][n];
			for (int i=0; i<dp.length; i++)
				for (int j=0; j<dp[i].length; j++)
					dp[i][j] = null;

			// Read in cell values.
			int[] vals = new int[n];
			for (int i=0; i<n; i++)
				vals[i] = stdin.nextInt();

			// First row.
			for (int i=0; i<s && i<n; i++)
				dp[1][i] = vals[i];

			// Run DP.
			for (int row=2; row<dp.length; row++) {
				for (int col=1; col<dp[row].length; col++) {

					int best = -1000000000;

					// Try building backwards - update as necessary.
					for (int trys=1; trys<=s; trys++) {
						if (col-trys < 0) break;
						if (dp[row-1][col-trys] == null) continue;
						int temp = dp[row-1][col-trys] + vals[col];
						if (temp > best)
							best = temp;
					}

					// Put in answer if it's a valid one.
					if (best != -1000000000)
						dp[row][col] = best;
				}
			}

			// Find global best.
			int best = -1000000000;
			for (int row=1; row<dp.length; row++)
				for (int col=n-s; col<n; col++)
					if (col >=0 && dp[row][col] != null && dp[row][col] > best)
						best = dp[row][col];

			// Output.
			if (best < 0 && s > n)
				best = 0;
			System.out.println(best);

			// Get next case.
			n = stdin.nextInt();
		}
	}
}