// Gaurav Aggarwal
 
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii > vii;
typedef vector<pll > vll;
#define pb push_back
#define mp make_pair 
#define mod 1000000007
#define F first
#define S second
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define For(i, a, b) for(__typeof (a) i=a; i<=b; i++)
#define inp_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {cin>>a[i];}
#define debug_arr(a,n) {{for(__typeof (n) i=0; i<n; ++i) {cout<<a[i]<<" ";}cout<<"\n";}}
 
ll power(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1;
        x = (x*x)%mod; 
    } 
    return res%mod; 
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("out.txt", "w", stdout); 
    // #endif  

    ll n,m,v,p;
    cin>>n>>m>>v>>p;

    ll a[n];
    inp_arr(a,n);

    sort(a,a+n);
    ll ans = n;

    ll sum[n+1] = {0};
    for(int i=1;i<=n;++i) {
        sum[i] = sum[i-1] + a[i-1];
    }

    // debug_arr(sum,n+1);

    for(int i=0;i<n;++i) {

        // cout<<i<<"---\n";

        ll prev = i;
        ll judgerem = v;
        if(prev < v) {
            judgerem -= prev;
        }
        else {
            judgerem = 1;
        }

        int choose = n - p;
        if(choose > i) {
            judgerem -= 1;
            judgerem = max(0ll, judgerem - (p-1));

            if(judgerem == 0) {

                if(a[i] + m >= a[choose]) break;
                else --ans;

            }

            else {

                if(a[i] + m < a[choose]) {
                    --ans;
                }
                else {
                    
                    ll points = judgerem*m;
                    // cout<<points<<" = points\n";
                    ll diff = a[i] + m - a[choose];
                    points -= diff;
                    // cout<<points<<" = rem points\n";

                    ll su = sum[choose] - sum[i+1];
                    // cout<<choose<<" "<<i<<"\n";
                    // cout<<su<<" = sum\n";

                    ll middle = choose - i - 1;
                    ll top = a[i] + m;
                    middle = middle * top;
                    su = middle - su;
                    // cout<<su<<" = sum\n";
                    if(su >= points) {
                        break;
                    }
                    --ans;

                    // cout<<middle<<" = middle\n";

                    // ll top = ceil((points*1.0) / middle);
                    // ll top2 = floor((points*1.0) / middle);

                    // cout<<top<<" = top\n";

                    // if((a[i+1] + top > a[i] + m) or a[choose-1] + top2 > a[i]+m) {
                        

                    //     --ans;
                    //     continue;
                    // }

                    // break;
                    // cout<<"hello\n";
                }
            }


        }
        else {
            break;
        }

    }

    cout<<ans<<"\n";

    return 0;
}

Measured memory_bytes: 1792