Bob has nn coins with integer values c1c2cn>0.c_1 \geq c_2 \geq \cdots \geq c_n > 0.

He is standing in front of a vending machine that offers nn candy bars with positive integer costs b1,b2,,bnb_1, b_2, \ldots, b_n. Bob notices that for every i{1,,n}i \in \{1, \ldots, n\}, it holds that b1+b2++bic1+c2++ci.b_1 + b_2 + \cdots + b_i \geq c_1 + c_2 + \cdots + c_i.

Furthermore, the total value of Bob's coins equals the sum of the costs of all the candy bars. The candy bars can be purchased in any order. In order to buy the ii-th candy bar, Bob has to insert coins of total value at least bib_i. However, the machine does not give him back any change.

Prove that Bob can buy at least half of the candy bars.