combinatorics: generate permutations
dynamic programming: knapsack with repetition