poj3258. binary search optimization. good