MInimum Money Needed

Can you please tell is repetition of same weight allowed and what should be the expected output for the test case
5 10
2 4 3 7 6

Yes repetition is allowed.
The answer should be 6

Can you explain how?

  1. 2 2 2 2 2
  2. 3 7
  3. 4 6
  4. 4 4 2
  5. 3 3 4
  6. 2 2 2 4

Hi you just gave me no of ways

And that too you are adding prices. The question says ith packet weighs i kg. The answer according to me should be 11

Or is there something else i am not understanding?