#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main()
{
    int n, k, x;
    cin >> n >> k >> x;

    vector<ll> b(n + 2);
    for(int i = 1; i <= n; i++){
        cin >> b[i];
    }
    int q;
    q = n + k - 1;
    for(int i = 1; i <= q; i++){
        int trenk = k + i - 1;
        vector<ll> pref(k + 2);
        int c;
        pref[1] = b[1];
        for(int j = 2 + i - 1; j <= trenk; j++){
            if(pref[j - 1] + b[j] * c < pref[j - 1] * b[j] * (c + 1)){
                if(c + 1 < x){
                    c++;
                }
            }
            pref[j] = pref[j - 1] + b[j] * c;
        }
        cout << pref[k] << endl;
    }
    return 0;
}