Chef & Sweets
CodeChefOpen on judge ↗
The Chef will have a celebration, and the ingredients for a large chocolate cake have to be bought. This is why he goes to the city's largest supermarket. Unfortunately, he only has $s$ dollars to spend on sugar. But that's no need to be gloomy; there are $n$ sorts of sugar in the supermarket, and he might be able to buy one of them. But it isn't all. The supermarket has an odd exchange policy: i
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