divide coins, knapsack