Bappa ka Prashad
CodeChefOpen on judge ↗
The festival was Ganesh Chaturthi and Bappa has come to Rohan's house. Rohan went to a sweet shop to buy sweets for Ganesh Chaturthi Prashad. When he reached the shop he saw that there were $N$ different sweets in the shop, $i$-th sweet cost $A_i$ rupees and the available quantity was $B_i$. But Rohan has a budget of $K$ rupees, and he wants the maximum number of sweets he can buy. Can you help
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