← All problemsSign in

Birthday Treat

Today is Bob's Birthday, he is very happy. To celebrate his birthday his mother gave him $K$ amount of money to buy chocolates for his friends. In the shop there are N jars of chocolates and in each jar there are infinite number of chocolates. To buy the chocolate of $ith$ type he has to spend $a[i]$ amount of price. But he doesn't want any money to be left. If there's money left with him after bu

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