Hi, I have a problem with my task. I have 2-dimensional board and in the middle are 3 numbers (1,1,1) - in vertical rotation. They make one segment. The „next step” will be one distinction of that segment. It is growing in the way that to each end, added are the next numbers (one greater than the previously added) with changing rotation (vertical- horizontal -vertical etc.)

On that 2-dimensional board I put point (x,y) in some place, which in case of meeting with growing segments will stop their growth. My job is to put for giving points (x,y) if growing segments

will ever meet with the points (if yes after how many steps ),if not then I have to write never.

I think I need to look for solution in moving diagonal. For main diagonal (0x0, 1x1, 2x2 etc.) Results are next power of number 2. Every next power of the number 2 they make ,,almost squares" with dimensions (2^¡)- 1 x 2^¡. At the end of that squares ( in middle of the bigger square) (1x2,3x4,7x8 etc.)....(each smaller is a half of the bigger one )) I am able to turn in any another diagonal and in her middle I am able to turn in another one (just how many times I need), but unfortunately there are a certain shifts (resulting probably from that the ,,almost squares" are not the real squares (3x4 instead of 4x4)). I m going to show it in the examples below for better understanding. I am adding also a link to the picture of the board (32x32) and few examples correct and invalid.

Board (-1- will never meet, 0x0 in the bottom left corner): img27.imageshack.us/img27/3600/planszad.png

Example 1. (Correct)

1). Preliminary result: 8 (4x4)

2). Preliminary result: 12 (6x2)

3). Preliminary result: 10 (5x3) (half dimensional of quadrangle 4x4 6x2)

4). End result: 12 (4x2)

Example 2 (correct)

x =2 y=10

1) preliminary result: 16 (8x8)

2) preliminary result: 24 (4x12)

4) end result: 28 (2x10)

Example 3 (invalid)

X=9. Y=3 (the result is number even and is placed UNDER dimensional)

1) preliminary result: 16 (8x8)

2) preliminary result: 24 (12x4)

Preliminary result: 28 (10x2)

4) end result: 30 (9x3)

Explanation: in the end result the result should be reduced by 2 not increased but I don't know what I am doing wrong. Please help me with this task, I need to finish it till the end of the week.

P.S. Coordinates x and y they fit in interval (-100000;100000) but growing segments are ,,quarters" symmetric so in case of negative coordinates we can make them into positive (x=|x|, y=|y|). I put a link to oryginal content of the task: img51.imageshack.us/img51/462/tresc.png