# Variable profit knapsack [closed]

We are given Cx,i, Cy,i, Cz,i ∈ ℕ and Px,i, Py,i, Pz,i > 0 for i=1,2,3 such that Px,1 < Px,2 < Px,3, Py,1 < Py,2 < Py,3, and Pz,1 < Pz,2 < Pz,3. We are also given K∈ℕ.

The values Cx,i and Px,i describe the content of a stack named x. From top to bottom, the stack x contains Cx,1 items each of profit Px,1, Cx,2 items each of profit Px,2, and Cx,3 items each of profit Px,3. The contents of stacks y and z are defined in the same way.

We are allowed to pop K items in total from the three stacks. How can I maximize the total profit?

• ok, what is your question? Sep 22, 2010 at 20:34
• it would be more readable if you used latex Sep 22, 2010 at 20:38
• And in general, it would be good to try to improve the formatting of the question. Now some parts are shown in a huge font (because they are marked as headings). Sep 22, 2010 at 21:03
• Seriously, posters should put more effort into communicating their question. As of now I can't even tell what the question is about. Voted to close. Sep 22, 2010 at 22:27
• @Robin: I agree that askers should put an effort into communicating their questions, but is it that difficult to guess what this particular question is? I am not saying that leaving the real question to a guess of reader is good, but it is definitely possible to guess what the question here is. Sep 23, 2010 at 1:19

This is not an answer, but the description of a problem which I think the asker wants to ask.

To vaibhav: While I believe that this is at least close to what you want to ask, please edit the question so that it is clearly understandable. Otherwise, we can only make a guess about what is being asked.

We are given Cx,i, Cy,i, Cz,i ∈ ℕ and Px,i, Py,i, Pz,i > 0 for i=1,2,3 such that Px,1 < Px,2 < Px,3, Py,1 < Py,2 < Py,3, and Pz,1 < Pz,2 < Pz,3. We are also given K∈ℕ.

The values Cx,i and Px,i describe the content of a stack named x. From top to bottom, the stack x contains Cx,1 items each of profit Px,1, Cx,2 items each of profit Px,2, and Cx,3 items each of profit Px,3. The contents of stacks y and z are defined in the same way.

We are allowed to retrieve K items in total from the three stacks. How can we find efficiently the way to maximize the total profit?

• @vaibhav: Please read this FAQ entry and others’ comments to understand why the question was closed. It seems that the recommended action is to edit the question instead of reposting a new version. After editing the question (and rereading it), email Suresh to ask him to reopen the quesiton. (more) Sep 23, 2010 at 12:14
• @vaibhav: (cont’d) However, before trying to improve the question, consider about Kristoffer Arnsfelt Hansen’s comments asking the meaning of “efficiently.” I used the ambiguous word “efficiently” exactly because I did not know what kind of efficiency you are looking for. In fact, I hope that considering about his comments may allow you to solve the problem by yourself. (more) Sep 23, 2010 at 12:14
• @vaibhav: (cont’d) Although this question was understandable to me, I have to say for the future that it was poorly written. Please learn how to state a problem clearly. Also, its bad formatting (unintended big letters) alone suggested that you did not care much about the question. If you care about the question, please take time to make the question better. Sep 23, 2010 at 12:15
• @vaibhav: I forgot to say: If you ask for reopening, you should unmark the “accepted” mark of this answer, because you will want another answer. Sep 23, 2010 at 12:26
• I have updated the problem.
– vaibhav
Sep 23, 2010 at 19:01