binary search, AC