Growing Orthogonal Spiral

No attempts yetTime limit1sMemory limit256 MB

Problem

A growing orthogonal spiral is a line that starts at the origin and turns as it grows. The first segment grows to the right (the positive xx direction), the second one up (the positive yy direction), the third one left (the negative xx direction), and the fourth one down (the negative yy direction). From the fifth segment on, the order right, up, left, down repeats.

Every segment length is a positive integer and has to be at least 1 larger than the length of the segment before it. The first segment can take any positive integer length. The picture below is the spiral whose segment lengths are 1, 2, 4, 6, 7, 9, 11, 12, 15, 20.

A point (x,y)(x, y) in the first quadrant is given. Decide whether the spiral can grow so that the end of its last segment lands exactly on (x,y)(x, y). Passing through the point does not count, the last segment has to end there. When the point can be reached, find the way of growing whose total segment length is smallest.

Input

The first line holds the number of test cases PP. (1P10001 \le P \le 1000)

Each of the next PP lines holds one test case. A line holds the test case number TT and the coordinates xx and yy of the point, separated by spaces. (1x100001 \le x \le 10000, 1y100001 \le y \le 10000)

Output

Print one line per test case. Start the line with the test case number TT read from the input.

If no way of growing ends at (x,y)(x, y), print NO PATH after TT.

If the point can be reached, print after TT the number of segments of the way with the smallest total, then the length of every segment in the order it grew. The way with the smallest total is always the only one, so the answer is fixed. Separate all values with one space.

In every test case whose point can be reached, 22 segments or fewer are enough.