Hero and his pizzas
CodeChefOpen on judge ↗
Hero loves pizza. He always kept looking for a place where he can get cheapest pizzas. and recently he did. This pizza place sells one pizza for P amount of rupees. Now, the special thing about this place, which makes it the cheapest is that it also exchanges K pizza boxes for a new pizza. Hero has N amount of rupees with him. You need to figure out what is the maximum number of pizzas he can eat?
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