Problem. A worker is paid one link of a 7-link gold chain per day for 7 days, at the end of each day. Cutting a link is expensive. What is the minimum number of cuts? (Change may be given back: on day the worker must hold pieces totalling exactly links.)

Answer. One cut, at the third link, leaving pieces : day 1 give the single link; day 2 give 2 and take 1 back; day 3 give 1; day 4 give 4 and take back 1 and 2; and so on, binary counting.

VariantBest
gold bar of units, cut into pieces (each cut makes one more piece) cuts give pieces : pays up to days
chain of links, a cut opens one link (it becomes a single piece and splits the chain) cuts pay up to days:
pieces for cuts single links and segments
general principlea multiset of piece sizes pays every amount iff, sorted, each piece is at most the sum of the smaller ones
int goldChainCuts(ll n) {                            // fewest cut links so that a chain of n links pays 1..n
    int k = 0;
    while (((ll)(k + 1) << (k + 1)) - 1 < n) k++;
    return k;
}
 
vector<ll> goldChainCutPositions(ll n) {             // 1-based positions of the links to cut
    int k = goldChainCuts(n); vector<ll> seg, cuts;
    ll rem = n - k;                                  // links left after the k cut links
    for (int i = 0; i <= k; i++) { seg.push_back(min((ll)(k + 1) << i, rem)); rem -= seg.back(); }   // capped doubling
    ll pos = 0;
    for (int i = 0; i < k; i++) { pos += seg[i] + 1; cuts.push_back(pos); }
    return cuts;
}
 
bool paysAll(vector<ll> pieces) {                    // every amount 1..sum is a sub-multiset sum
    sort(all(pieces)); ll reach = 0;
    for (ll p : pieces) { if (p > reach + 1) return false; reach += p; }
    return true;
}