Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l=input().split()
- x=int(0)
- n=int(0)
- p=0
- k=len(l)-1
- l.append(50001)
- while k<len(l) and p>=0 and p<k:
- s=(k+p)//2
- l[s]=int(l[s])
- l[s-1]=int(l[s-1])
- if l[s]<50000 and l[s-1]>=50000:
- x=l[s]
- n=s+1
- break
- if l[s]>=50000:
- p=s+1
- continue
- if l[s]<50000:
- k=s
- print (len(l)-n,x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement