Go further for the optimal greedy algorithm