import sys



read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

inputs = sys.stdin.buffer.readlines





# mod=10**9+7

# rstrip().decode('utf-8')

# map(int,input().split())

#import numpy as np









def main():

	n,m,v,p=list(map(int,input().split()))

	A=list(map(int,input().split()))

	A.sort(reverse=True)

	teki=A[p-1]

	

	ans=0

	cnt=1

	d=0

	

	for i in range(p,n):

		if A[i]+m<teki:break

		d+=cnt*(A[i-1]-A[i])

		if d>m*(n-v):break

		cnt+=1

		ans+=1

	print((p+ans))

	

if __name__ == "__main__":

	main()

import sys



read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

inputs = sys.stdin.buffer.readlines





# mod=10**9+7

# rstrip().decode('utf-8')

# map(int,input().split())

#import numpy as np

import bisect







def main():

	n,m,v,p=list(map(int,input().split()))

	A=list(map(int,input().split()))

	A.sort(reverse=True)

	teki=A[p-1]

	

	ans=0

	cnt=1

	d=0

	

	for i in range(p,n):

		if A[i]+m<teki:break

		d+=cnt*(A[i-1]-A[i])

		if d>m*(n-v):break

		cnt+=1

		ans+=1

	print((p+ans))

	

if __name__ == "__main__":

	main()

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np
def main():
    n, m, v, p = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    teki = A[p - 1]
    ans = 0
    cnt = 1
    d = 0
    for i in range(p, n):
        if A[i] + m < teki:
            break
        d += cnt * (A[i - 1] - A[i])
        if d > m * (n - v):
            break
        cnt += 1
        ans += 1
    print((p + ans))


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines
# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np
import bisect


def main():
    n, m, v, p = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    teki = A[p - 1]
    ans = 0
    cnt = 1
    d = 0
    for i in range(p, n):
        if A[i] + m < teki:
            break
        d += cnt * (A[i - 1] - A[i])
        if d > m * (n - v):
            break
        cnt += 1
        ans += 1
    print((p + ans))


if __name__ == "__main__":
    main()

+import bisect + +