← All problemsSign in

Satbir and Celebration

Satbir recently graduated from College. So, he goes for a celebration with you and Aryan. He went to a chocolate shop and wants to buy exactly $N$ chocolates from the shop. The MRP of $i^{th}$ chocolate in the shop is equal to the $i^{th}$ prime number. But, as a special offer, he only needs to pay the price equal to maximum MRP of any number of chocolates he bought, i.e. suppose he buys $5$

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