Diagon Alley
CodeChefOpen on judge ↗
Harry, Ron and Hermione visits Diagon alley to buys things for their fifth year at Hogwarts. There are two types of price rates at Diagon alley- $a$ & $b$ Hermione currently have $0$ galleons with her. She can buy $k$ things in the following manner. For the first thing she need not pay any money and she would get $a$ galleons along with the item bought, for the second thing she need to spend $b$
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