using System;
using System.Linq;

class Program
{
    static void Main()
    {
        var firstLine = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int n = firstLine[0], k = firstLine[1], x = firstLine[2];
        long[] p = Console.ReadLine().Split().Select(long.Parse).ToArray();

        long[] result = new long[n - k + 1];

        for (int start = 0; start <= n - k; start++)
        {
            long[] b = new long[k];
            Array.Copy(p, start, b, 0, k);

            long[] dp = new long[x + 1];
            for (int j = 0; j <= x; j++) dp[j] = long.MinValue;
            dp[1] = 0;

            foreach (var val in b)
            {
                long[] next = new long[x + 1];
                for (int j = 0; j <= x; j++) next[j] = long.MinValue;

                for (int j = 1; j <= x; j++)
                {
                    if (dp[j] == long.MinValue) continue;

                    next[j] = Math.Max(next[j], dp[j] + j * val);

                    if (j + 1 <= x)
                        next[j + 1] = Math.Max(next[j + 1], dp[j] + (j + 1) * val);
                }

                dp = next;
            }

            result[start] = dp[x];
        }

        Console.WriteLine(string.Join(" ", result));
    }
}