N,M,V,P,*a = $<.read.split.map &:to_i
Y = a.sort![-P]
X = Y-M
A = a.inject(Hash.new 0) {|h,i| h[i]+=1; h}.to_a
x,y = [X,Y].map {|n| A.bsearch_index {|a| a[0]>=n} }
c = A[0...x].inject(0) {|s,a| s+a[1]}
v = (V-P+1-c)*M
t = A[x][0]+M
w = A[x...y].inject(0) {|s,a| s + (t-a[0])*a[1]} + (t-A[y][0])*(N-P-y+1)
x.upto(y-1) {|i|
  break  if v <= w
  a,b = A[x,2]
  c += a[1]
  w += (b[0]-a[0])*(y-i)
end