n,k,l,u=map(int,input().split()) mid=(l+u)//2 A=[int(_) for _ in input().split()] avg=sum(A)//n un_nature=0 for i in range(n): tmp=A[i]+mid-avg if tmpu: un_nature+=(tmp-u+k-1)//k print(un_nature)