POJ#1064 Binary search to get optimal solution. Rank:11992