remember to take negative... stuck for hours due to the negative...
identify whether square touch the y = 2000000,
then merge the range instead of generating every position.
and deduct the Beacon.
using the equation method.
assume all the side is 4 equation
upper_upward = y = x + c + distance
lower_upward = y = x + c - distance
upper_downward = y = -x + c + distance
lower_downward = y = -x + c - distance
as only one position, the point must attached to 4 lines above. (2 lines in x and 2 lines in y)
hence there must have variance of 2 for each pair above.
get the average of the C (just -1 or +1 as they are 1 position above or bottom), that is the equation for x and y.
intersect the equation, we can get the point x and y
and multiple the required 4000000 + [y]