output_description: Print the number of problems that have a chance to be chosen for the
  problemset.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M V P
      A_1 A_2 ... A_N
attempt: # 解説を見た
  
  
  def solve(N: int, M: int, V: int, P: int, A: "list[int]") -> int:
      """
      入れてよい票 < M*V
          M*V投票するとjを超えるスコアを持つ問題数がP以上になり、不可能
  
      入れてよい票 >= M*V
          可能
  
          次の条件を満たせば可能といえる
          # 各問題への投票数は許容範囲内
          # すべてのjudgeがV投票
          # すべてのjudgeが同じ問題に2度以上投票していない
          投票してよい問題abc...zを
          許容される投票数だけ連続させた列(最大M=すべてのjudgeが投票した場合)
          aaaabbbcc...z
          仮定より長さMV以上なので,
          冒頭の区間(長さMV)に対し,judgeを0...M-1,0...M-1,...と割り当てることができる
          この割り当ては,3つの条件を満たす
      """
  
      from itertools import accumulate
  
      def is_ok(j):
          if j < P:
              return True
              # P位以内にM回加点
  
          X = A[j] + M  # 加点後のj位のスコアX
          if X < A[P]:
              return False
              # A[j]にM回加点、P位に加点なしでも勝てん
  
          return (j - P) * X - (acc[j - 1] - acc[P - 1]) >= M * (V - (P + N - j))
          # return (P - 1 + 1 + N - j) * M + sum(X - A[k] for k in range(P, j)) >= M * V
          # (P-1)位以内,j位以降にM回加点
          # P位～(j-1)位は,加点後のj位を超えない範囲で加点
          # X>=A[P]>=A[k]
          # なので,各kに対し,0点以上加点できる
          # 移項して,累積和でオーダーを落とした
  
      def binary_search():
          ok = 1
          ng = N + 1
          while abs(ok - ng) > 1:
              mid = (ok + ng) // 2
              if is_ok(mid):
                  ok = mid
              else:
                  ng = mid
          return ok
  
      (*A,) = sorted(A, reverse=True)
      A = [0] + A  # 0-indexed -> 1-indexed
      acc = tuple(accumulate(A))
      return binary_search()
  
  
  def main():
      import sys
  
      input = sys.stdin.readline
  
      N, M, V, P = map(int, input().split())
      A = map(int, input().split())
      print(solve(N, M, V, P, A))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: 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?
samples: [{"input": "6 1 2 2\n    2 1 1 3 0 2", "output": "5\n    \n\nIf the only judge votes for problems 2 and 5, the scores will be 2 2 1 3 1 2.\nThe problemset will consist of problem 4 and one of problems 1, 2, or 6.\n\nIf the only judge votes for problems 3 and 4, the scores will be 2 1 2 4 0 2.\nThe problemset will consist of problem 4 and one of problems 1, 3, or 6.\n\nThus, problems 1, 2, 3, 4, and 6 have a chance to be chosen for the\nproblemset. On the contrary, there is no way for problem 5 to be chosen.\n\n* * *"}, {"input": "6 1 5 2\n    2 1 1 3 0 2", "output": "3\n    \n\nOnly problems 1, 4, and 6 have a chance to be chosen.\n\n* * *"}, {"input": "10 4 8 5\n    7 2 3 6 1 6 5 4 6 5", "output": "8"}]