Similar to this question but items don't have value $v$.

Max weight $W$, every item has weight $w$, must add exactly $L$ items to the knapsack, need to get max weight as possible.

  • $\begingroup$ Take the value of the item as the weight of the item. Then, it is the same problem. $\endgroup$ Jan 29, 2022 at 11:58
  • $\begingroup$ You are right. What does $n(V+1)$ mean in that answer? $\endgroup$
    – Deqing
    Jan 29, 2022 at 12:13
  • 1
    $\begingroup$ I have added another answer to the question (probably simpler), you can check that. $\endgroup$ Jan 29, 2022 at 12:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.