Final version of "Discrete knapsack problem"