Friends and Presents (binary search)