← All problemsSign in

Chef And Icecreams

Chef decided to take his Ice-cream wagon to the city carnival today. The colorful lights of his wagon attracted a lot of children and soon he was surrounded by them. The chef has N different flavors of ice-cream, where the delish value of each flavor is given by Di (1 ≤ i ≤ N). Also for every i-th flavor, Chef only has Pi (1 ≤ i ≤ N) ice-creams of that flavor. Chef had M children asking for th

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start