Problem B. Touch screen 2.5
Problem
We have a square-shape touch screen with 5 x 5 pixels, which can
be either black or white in color.
A move consists of toggling a square of n x n pixels on the screen (the square must lie fully within the screen), where n can be 2,3,4 or 5.
The screen contains 24 white pixels and only one black pixels initially. How to toggle the screen so that all pixels are white?
Input
There are multiple test cases, each on a single line.
Each test case contain 2 integers x and y, 1 ≤ x, y ≤ 5, specifying the coordinates of the black pixel initially.
Note that the top left pixel has coordinates (1,1); the top right pixel has coordinates (5, 1); the bottom right pixel has coordinates (5, 5); and so on. The input ends with two zeros, which should not be processed.
Output
For each test case, output the moves that can toggle the screen to white
with the minimum number of moves. For each move, print "x y n", where x and y are the coordinates of the top left corner of the toggling square, and n is the size of the toggling square.
You don't need to care about the order of steps.
If there is no solution for the input, print a line "No Result".
Sample Input
1 1
3 3
0 0
Sample output
No Result
1 1 3
3 3 3
1 4 2
4 1 2
1 1 5
Author
Ngai Ka Kit