do not use dp, use greedy