#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#define _GLIBCXX_DEBUG
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
using namespace std;
using ll = long long;
const ll INF = 50000000000000000;
const ll dx[8] = {1,0,-1,0,1,1,-1,-1};
const ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll mod(ll x,ll m){return x & m;}
ll modinv(ll a,ll m){
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n, ll m) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % m;
        a = a * a % m;
        n >>= 1;
    }
    return res;
}
ll npow(ll a, ll n){
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a;
        a = a * a;
        n >>= 1;
    }
    return res;
}
ll yaku(ll x){
    ll cnt = 0;
    for(int i = 1; i * i <= x; i++){
        if(x % i == 0){
            if(i == x / i) cnt++;
            else cnt += 2;
        }
    }
    return cnt;
}
ll modwaru(ll a, ll b, ll m){
    a %= m;
    return a * modinv(b, m) % m;
}
ll gcd(ll x, ll y){
    if(x % y == 0)return y;
    else return gcd(y, x % y); 
}
struct UnionFind {
    vector<int> par;

    UnionFind(int N) : par(N) {
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { 
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(){
    ll K, N, M, wa = 0;
    cin >> K >> N >> M;
    vector<ll> A(K), ans(K);
    vector<pair<ll,ll>> C(K);
    for(int i = 0; i < K; i++) cin >> A[i];
    for(int i = 0; i < K; i++){
        ll s = M * A[i] / N;
        ans[i] = s;
        C[i].first = s * N - M * A[i];
        C[i].second = i;
    }
    for(int i = 0; i < K; i++) wa += ans[i];
    sort(ALL(C));
    for(int i = 0; i < M - wa; i++){
        ans[C[i].second]++;
    }
    for(int i = 0; i < K; i++){
        cout << ans[i];
        if(i != K - 1) cout << ' ';
    }
    cout << endl;
}
//ye moh moh ke dhaage,tere ungliyon se ja uljhe

#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
#define dbug(x) cout<<#x<<"="<<x<<endl;
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

ll fr[3*100002];
ll mex[3*100002];

int main(){
    ll n,k,ans=0;
    cin>>n>>k;

    forn(i,n){
        ll te;
        cin>>te;
        fr[te]++;
    }

    forn(i,n){
        for(ll j=0;j<(min(fr[i],k));j++){
            if(mex[j]==i) mex[j]++;
        }
    }

    forn(i,k) ans+=mex[i];
    cout<<ans;
}