lower_bound, lower_bound_n, and count algorithms