Loading...
Loading...
Loading...
A shop sells bundles of different sizes, listed in ascending order. A customer needs at least x units. Print the size of the smallest bundle that has at least x units, or -1 if none does.
Example
Input
5 10 25 50 100 250 60
Output
100
Try the problem first. Open one hint at a time.
This is a lower bound: the first bundle whose size is at least x.
If the lower bound is n, no bundle is large enough.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor