Problem:
Score : 700 points

Problem Statement

N problems are proposed for an upcoming contest. Problem i has an initial integer score of A_i points.

M judges are about to vote for problems they like. Each judge will choose exactly V problems, independently from the other judges,
and increase the score of each chosen problem by 1.

After all M judges cast their vote, the problems will be sorted in non-increasing order of score, and the first P problems will be chosen for the problemset.
Problems with the same score can be ordered arbitrarily, this order is decided by the chief judge.

How many problems out of the given N have a chance to be chosen for the problemset?

Constraints

2 \le N \le 10^5

1 \le M \le 10^9

1 \le V \le N - 1

1 \le P \le N - 1

0 \le A_i \le 10^9

Input

Input is given from Standard Input in the following format:

N M V P
A_1 A_2 ... A_N

Output

Print the number of problems that have a chance to be chosen for the problemset.

Sample Input 1

6 1 2 2
2 1 1 3 0 2

Sample Output 1

5

If the only judge votes for problems 2 and 5, the scores will be 2 2 1 3 1 2.
The problemset will consist of problem 4 and one of problems 1, 2, or 6.

If the only judge votes for problems 3 and 4, the scores will be 2 1 2 4 0 2.
The problemset will consist of problem 4 and one of problems 1, 3, or 6.

Thus, problems 1, 2, 3, 4, and 6 have a chance to be chosen for the problemset. On the contrary, there is no way for problem 5 to be chosen.

Sample Input 2

6 1 5 2
2 1 1 3 0 2

Sample Output 2

3

Only problems 1, 4, and 6 have a chance to be chosen.

Sample Input 3

10 4 8 5
7 2 3 6 1 6 5 4 6 5

Sample Output 3

8

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

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

#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,0,n)
#define rrep3(i,begin,end) for(int i=(int)(end-1),i##_end=(int)(begin);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
#define each(x,a) for(auto&x:a)
#define sz(x) ((int)(x).size())

struct IoSetup{
  IoSetup(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  };
} ioSetup;

using ll=long long;

template<class T,class U>ostream &operator<<(ostream &o,const pair<T,U>&j){o<<"{"<<j.first<<", "<<j.second<<"}";return o;}
template<class T,class U>ostream &operator<<(ostream &o,const map<T,U>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const set<T>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const multiset<T>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const vector<T>&j){o<<"{";for(int i=0;i<(int)j.size();++i)o<<(i>0?", ":"")<<j[i];o<<"}";return o;}
#ifdef LOCAL
inline void dump(void){cerr<<endl;}
template<class Head,class... Tail> inline void dump(Head&& head,Tail&&... tail){cerr<<head<<" ";dump(tail...);}
#define debug(...) do{cerr<<"[L."<<__LINE__<<"]\t"<<#__VA_ARGS__<<"=";dump(__VA_ARGS__);}while(0)
#else
#define dump(...)
#define debug(...)
#endif

template<class T>inline void sort(T&a) { sort(a.begin(), a.end()); }
template<class T, class Compare>inline void sort(T&a, Compare comp) { sort(a.begin(), a.end(), comp); }
template<class T>inline void rsort(T&a) { sort(a.rbegin(), a.rend()); }
template<class T>inline void reverse(T&a) { reverse(a.begin(), a.end()); }
template<class T>inline T Sum(vector<T>&a){return accumulate(a.begin(), a.end(), (T)0);}
template<class T>inline T max(vector<T>&a){return *max_element(a.begin(), a.end());}
template<class T>inline T min(vector<T>&a){return *min_element(a.begin(), a.end());}

template<class T,class U>inline bool chmax(T&a,const U&b){return(b>a)?(a=b,true):false;}
template<class T,class U>inline bool chmin(T&a,const U&b){return(b<a)?(a=b,true):false;}

ll gcd(const ll a, const ll b){return b ? gcd(b, a % b) : a;}
ll lcm(const ll a, const ll b){return a / gcd(a, b) * b;}

class in {
  int n;
public:
  in() {n=-1;}
  in(int n_) : n(n_){};
  template <class T> operator T() { T ret; cin >> ret; return ret; }
  template <class T> operator vector<T>() {assert(n >= 0); vector<T> ret(n); for(int i=0;i<n;++i) cin>>ret[i]; return ret; }
};

template<class T> void print(const T& a){ cout << a; }
int out(){ cout<<'\n'; return 0; }
template<class T> int out(const T& t){ print(t); cout<<'\n'; return 0; }
template<class Head, class... Tail> int out(const Head& head, const Tail&... tail){ print(head); cout << " "; out(tail...); return 0; }

template <std::uint_fast64_t Mod> class Modular {
  using u64 = std::uint_fast64_t;
public:
  u64 a;
  constexpr Modular(const u64 x = 0) noexcept : a(x % Mod) {}
  constexpr u64 val() const noexcept { return a; }
  constexpr Modular operator+(const Modular rhs) const noexcept { return Modular(*this) += rhs; }
  constexpr Modular operator-(const Modular rhs) const noexcept { return Modular(*this) -= rhs; }
  constexpr Modular operator*(const Modular rhs) const noexcept { return Modular(*this) *= rhs; }
  constexpr Modular operator/(const Modular rhs) const noexcept { return Modular(*this) /= rhs; }
  constexpr bool operator==(const Modular rhs) const noexcept { return Modular(*this).val() == rhs.val(); }
  Modular &operator+=(const Modular rhs) noexcept { a += rhs.a; if (a >= Mod) a -= Mod; return *this; }
  Modular &operator-=(const Modular rhs) noexcept { if (a < rhs.a) a += Mod; a -= rhs.a; return *this; }
  Modular &operator++() noexcept { return *this += 1; }
  Modular &operator--() noexcept { return *this -= 1; }
  Modular &operator*=(const Modular rhs) noexcept { a = a * rhs.a % Mod; return *this; }
  Modular &operator/=(Modular rhs) noexcept { u64 exp = Mod - 2; while(exp){ if(exp % 2) *this *= rhs; rhs *= rhs; exp /= 2; } return *this; }
};
template <std::uint_fast64_t Mod> ostream& operator<<(ostream& os, const Modular<Mod>& m){ return os << m.a; }

const double pi=acos(-1);
const double eps = 1e-9;
const ll inf = 1001001001;
const ll mod=(ll)1e9+7;
using mint = Modular<mod>;

//}}}

int main(){
  ll N = in();
  ll M = in();
  ll V = in();
  ll P = in();
  vector<ll> A = in(N);
  sort(A);

  // A[x]の問題が採用され得るか否か
  auto f = [&](ll x){
    debug(x);

    vector<ll> B(A);
    ll voteNum = M * V;

    // 全員B[x]に投票
    B[x] += M;
    voteNum -= M;
    debug(voteNum);

    ll target = B[x];
    ll cnt = 0;
    rep(i, N){
      if(A[i] > target) cnt++;
    }
    if (cnt >= P) return false;

    // 無駄に消化できる票を消化
    voteNum -= M * (P - 1);
    sort(B);
    debug(B);

    ll sum = 0;
    rep(i, N){
      if(B[i] <= target){
        if(B[i] <= target - M){
          sum += M;
          B[i] += M;
        }else{
          sum += target - B[i];
          B[i] = target;
        }
      }
    }
    debug(B);
    debug(sum);
    debug(voteNum);
    debug(sum >= voteNum);

    return sum >= voteNum;
  };

  ll ans = 0;
  ll ok = N - 1;
  ll ng = -1;
  while(abs(ok - ng) > 1){
    ll md = (ok + ng) / 2;
    (f(md) ? ok : ng) = md;
  }
  ans = N - ok;
  out(ans);
}