Collect pebbles
CodeChefOpen on judge ↗
You are going to visit a beach this new Year, where there are $N$ places to visit. You know that there are 2 types of pebbles on the beach i.e. X and Y . You want to collect at least $A$ pebbles of type X and at least $B$ pebbles of type Y. You have the information that there are x[i] pebbles of type X and y[i] pebbles of type Y at the $ith$ place. You are at the beach for only $1$ day so you wan
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start