Modified binary_search: find the closest value smaller than N.