Bob has n coins with integer values
c1≥c2≥⋯≥cn>0.
He is standing in front of a vending machine that offers n candy bars with positive integer costs b1,b2,…,bn. Bob notices that for every i∈{1,…,n}, it holds that
b1+b2+⋯+bi≥c1+c2+⋯+ci.
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 i-th candy bar, Bob has to insert coins of total value at least bi. However, the machine does not give him back any change.
Prove that Bob can buy at least half of the candy bars.