Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Let's change the question if we know the maximum size of a bag what is the minimum number of bags you can make
note that as the maximum size increases the minimum number of bags decreases so we can binary search the maximum size