import bisect

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

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



ls.sort()

total=m*v

for i in range(min(v-1,p-1)):

    ls[-i-1]+=m

    total-=m



ac = [0]*n

for i in range(n-1):

    ac[i+1] = ac[i]+(ls[i+1]-ls[i])*(i+1)



ans=p

for i in range(n-p):

    idx=bisect.bisect_right(ls,ls[i]+m)

    if n-idx>=p:

        continue

    totalnow=total-m*(i+1)

    if totalnow <= 0:

        ans += 1

        continue

    ok=ac[-p]-ac[i]-(ls[-p]-ls[i])*(i+1)+(ls[i]+m-ls[-p])*(n-p-i)

    if ok< totalnow:

        continue

    ans += 1



print(ans)



import bisect

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

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



ls.sort()

total=m*v

for i in range(min(v-1,p-1)):

    ls[-i-1]+=m

    total-=m



ac = [0]*n

for i in range(n-1):

    ac[i+1] = ac[i]+(ls[i+1]-ls[i])*(i+1)



l=-1

r=n

while l+1<r:

    i=(l+r)//2

    idx=bisect.bisect_right(ls,ls[i]+m)

    if n-idx>=p:

        l=i

        continue

    totalnow=total-m*(i+1)

    if totalnow <= 0:

        r=i

        continue

    ok=ac[-p]-ac[i]-(ls[-p]-ls[i])*(i+1)+(ls[i]+m-ls[-p])*(n-p-i)

    if ok< totalnow:

        l=i

        continue

    r=i



print((n-r))



import bisect

n, m, v, p = list(map(int, input().split()))
ls = list(map(int, input().split()))
ls.sort()
total = m * v
for i in range(min(v - 1, p - 1)):
    ls[-i - 1] += m
    total -= m
ac = [0] * n
for i in range(n - 1):
    ac[i + 1] = ac[i] + (ls[i + 1] - ls[i]) * (i + 1)
ans = p
for i in range(n - p):
    idx = bisect.bisect_right(ls, ls[i] + m)
    if n - idx >= p:
        continue
    totalnow = total - m * (i + 1)
    if totalnow <= 0:
        ans += 1
        continue
    ok = (
        ac[-p] - ac[i] - (ls[-p] - ls[i]) * (i + 1) + (ls[i] + m - ls[-p]) * (n - p - i)
    )
    if ok < totalnow:
        continue
    ans += 1
print(ans)

import bisect

n, m, v, p = list(map(int, input().split()))
ls = list(map(int, input().split()))
ls.sort()
total = m * v
for i in range(min(v - 1, p - 1)):
    ls[-i - 1] += m
    total -= m
ac = [0] * n
for i in range(n - 1):
    ac[i + 1] = ac[i] + (ls[i + 1] - ls[i]) * (i + 1)
l = -1
r = n
while l + 1 < r:
    i = (l + r) // 2
    idx = bisect.bisect_right(ls, ls[i] + m)
    if n - idx >= p:
        l = i
        continue
    totalnow = total - m * (i + 1)
    if totalnow <= 0:
        r = i
        continue
    ok = (
        ac[-p] - ac[i] - (ls[-p] - ls[i]) * (i + 1) + (ls[i] + m - ls[-p]) * (n - p - i)
    )
    if ok < totalnow:
        l = i
        continue
    r = i
print((n - r))

-ans = p -for i in range(n - p): +l = -1 +r = n +while l + 1 < r: +    i = (l + r) // 2 +        l = i -        ans += 1 +        r = i +        l = i -    ans += 1 -print(ans) +    r = i +print((n - r))