We have a problem as follows:
Suppose you had $n$ bags of sand with different prices $p_1$ money units, $p_2$ money units, ..., $p_n$ money units.
You are given some subset of the bags of sands for free, and you know for certain which bags you are given. Suppose now you also now how many grains of sand each bag has, say $s_1, \cdots, s_n$ grains of sand.
You want to buy at least $N=\frac{s_1+\cdots+s_n}2$ grains of sand. Assume you are not given at least $N$ grains of sand for free. How do you choose which bags of sand to buy paying as few money units as possible?
An algorithm I have considered is as following:
Buy the bag with the most grains of sand per money units unless there is a bag $Q$ which could give you a total of at least $N$ grains of sand. In the second case, consider the two possibilities of buying the bag with the most grains of sand per money units versus just buying bag $Q$. Apply the algorithm recursively until it halts and you have a list of possibilities all giving you at least $N$ grains of sand.
Now choose any of those possibilities with the minimum amount of money required.
Will this algorithm result in a guaranteed price minimum?