dp + greedy