There is a grid of length and width points. A clock is placed on each grid point. The clocks are all analogue showing a single hour hand initially pointing at .
A sequence is created where:
The four numbers represent a range within the grid, with the first pair of numbers representing the x-bounds and the second pair representing the y-bounds. For example, if , the range would be and , and would include clocks.
For each , the clocks within the range represented by are moved to the next hour .
We define to be the sum of the hours that the clock hands are pointing to after timestep .
You are given , , and .
Find .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.