def find_le(a, x):
 try:
  return a[bisect_right(a, x)]
 except IndexError:
  return a[(-1)]

def find_le ( a , x ) : try : return a [ bisect_right ( a , x ) ] except IndexError : return a [ ( - 1 ) ]
find rightmost value in a less than or equal to x .