Problem #232
A Long Walk
You have a set S that stores distinct points.
Let the points consisted in a walk with 30 teleportations be
(x_0,y_0), (x_1,y_1), .., (x_{30},y_{30})
(x_0,y_0) = (0,0)
(x_{30},y_{30}) = (X,Y)
For 1 \le i \le 30
(x_i,y_i) = (x_{i-1} , y_{i-1} + 2^{i-1})
or
(x_i,y_i) = (x_{i-1} + 2^{i-1} , y_{i-1})
A walk is called a valid walk when Y lies in the range [123456789,987654321].
In a valid walk for 0 \le i \le 29, insert point (X - x_i, Y - y_i) in set S.
Find the maximum size of set S by taking 28 valid walks.