There is a grid of length and width 50515093 populated with a clock in each grid square. The clocks are all analogue showing a single hour hand initially pointing at 12.
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 196 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 .