結果 : compare greedy algorithm and dynamic programming