結果 : algorithm for greedy approach