[HELP] ByteRace Battery Needed!

How to solve Battery Needed from today’s ByteRace Contest?

The key observation for me was that you could try to imagine which batteries you’d pick at the final time and work backwards from there, rather than deciding which to pick at time 1, 2, …


Oh. That’s a Nice trick to solve this problem.