#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, k, x;
    cin >> n >> k >> x;

    vector<long long> niz(n);
    for(int i = 0; i < n; i++) cin >> niz[i];

    vector<long long> rezultat;

    for(int pocetak = 0; pocetak + k <= n; pocetak++) {
        vector<long long> dp(x+1, LLONG_MIN);
        dp[0] = 0;

        for(int i = 0; i < k; i++) {
            vector<long long> novi_dp(x+1, LLONG_MIN);
            for(int povecanja = 0; povecanja <= x; povecanja++) {
                if(dp[povecanja] == LLONG_MIN) continue;
                long long c = 1 + povecanja;

                novi_dp[povecanja] = max(novi_dp[povecanja], dp[povecanja] + c * niz[pocetak + i]);

                if(povecanja + 1 <= x) {
                    long long c_povecano = c + 1;
                    novi_dp[povecanja + 1] = max(novi_dp[povecanja + 1], dp[povecanja] + c_povecano * niz[pocetak + i]);
                }
            }
            dp = novi_dp;
        }

        rezultat.push_back(dp[x]);
    }

    for(int i = 0; i < rezultat.size(); i++) {
        if(i) cout << " ";
        cout << rezultat[i];
    }
    cout << "\n";

    return 0;
}