poj3122. binary search optimization. good