docs: def BSearchFloor(a, x, lo=0, hi=None):
      """Returns highest i such as a[i] <= x, or -1 if x < all elements in a
  
      So, if x is in between two elements in a, this function will return the
      index of the lower element, hence "Floor".
  
      Arguments:
        a -- ordered numeric sequence
        x -- element to search within a
        lo -- lowest index to consider in search
        hi -- highest index to consider in search"""
      if len(a) == 0: return -1
      hi = hi if hi is not None else len(a)
      pos = bisect_left(a, x, lo, hi)
      return pos - 1 if pos >= hi \
          else (pos if x == a[pos] else (pos - 1 if pos > lo else -1))