Computer Science, asked by manikantanagalla2, 10 months ago

there are N balls in a row numbered 1to n from left to right

Answers

Answered by Bharathreddybbbb
1

n,u,d=map(int,input().split())

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

sc=0

idx=0

for i in range(n-1):

if l[i]==l[i+1]:

idx=i+1

elif l[i+1]>l[i]:

if l[i+1]-l[i]<=u:

idx=i+1

else:

break

else:

if l[i]-l[i+1]<=d:

idx=i+1

else:

if sc==0:

idx=i+1

sc=sc+1

else:

break

print(idx+1,end="")

Similar questions