poj3273. Greedy algo, binary search