結果 : compare between dynamic programming and greedy algorithm