Racing Refuels
CodeChefOpen on judge ↗
In racing, you refuel your car in the pitstops, and it’s very important to carefully plan pit stops. 1 unit of fuel is enough for exactly 1 lap. At the beginning of each lap, the number of units of fuel in your car must be a positive integer that doesn't exceed the tank capacity N, and it will decrease by 1 during a lap. After each lap, you can spend P seconds to visit a pit stop and refuel your
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