noname001rev's blog

By noname001rev, 9 years ago, In English

Berla is organizing a garage sale. She is going to sell N items to M friends, who are going to offer a quantity for each item they want(they can offer to all items or to none of them). She is going to sell each item to the best offer she is going to get. However, she is concerned about the posibility that only one friend could keep all the items, so she has decided to put a limit T, T is the maximum number of objects one friend can get at most. Berla also wants to maximize the quantity she can gain(the sum of the prices she sell the items). Once she knows all the proposals from his friends, What is her best strategy to sell?, 1<=N,M<=100, 1<=T<=N

If she doesn't have any friend offering for more than T items, the problem is ok, however, the problem arises when at least one friend is offering to more than T items, because she has to decide how to allocate all the items between his friends.

I am trying a greedy approach, both constructing the solution and discarting items, having no success. Any suggestion is appreciated.

  • Vote: I like it
  • -3
  • Vote: I do not like it