Bessie is on a diet and may eat no more than $C$ ($10 \le C \le 35000$) calories per day. To tease her, Farmer John sets out $B$ ($1 \le B \le 21$) buckets of feed, each holding some number of calories (each value is between $1$ and $35000$, and the values need not be distinct). Bessie has no self-control: once she starts on a bucket, she eats all of it.
Bessie is not good at combinatorics. Determine the combination of feed buckets that lets her eat as many calories as possible without exceeding the limit $C$, and report that number of calories.