| # | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
|---|---|---|---|---|---|---|---|---|---|
| 120100713 |
Contestant: Believer_Ayush |
1539C - 49 | PyPy 3 | Time limit exceeded on test 18 | 1000 ms | 31416 KB | 2021-06-20 14:16:44 | 2021-06-20 15:46:17 |
from sys import stdin,stdout
nmbr = lambda: int(input())
lst = lambda: list(map(int, input().split()))
def ceil(nn,dd):
fl=nn//dd
if dd*fl<nn:fl+=1
return fl
for _ in range(1):#nmbr()):
# n=nmbr()
n,extra,d=lst()
a=sorted(lst())
b=[]
for i in range(1,n):
if a[i]-a[i-1]>d:
req=ceil(a[i]-a[i-1],d)+1
b+=[req-2]
b.sort()
sm=c=0
ans=len(b)+1
# print(b)
for v in b:
if sm+v>extra:break
sm+=v
c+=1
print(ans-c)