Java greedy algorithm (find from a thousand decimals and the closest to 268.8)