← All problemsSign in

Greedy Laila

Laila is a little dog. But despite the fact she is still a puppy she already knows about the pretty things that coins are. She knows that for every coin she can get very tasty bone from his master. She believes that some day she will find a treasure and have loads of bones. And finally she found something interesting. A wooden chest containing N coins! But as you should remember, Laila is just

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