結果 : greedy algorithm example python