114 - Simulation Wizardry
This problem challenges your ability to read through its cumbersome description.
Some notes:
- Walls are on the edge, i.e.,
x == 1 || x == width || y == 1 || y == height
. - A ball dies as soon as a movement causes its lifetime reaching zero and cannot gain points or (negative) cost.
A reference solution is here.