NC206962. MovingBuildings
描述
输入描述
The first line of input contains a single decimal integer P, (1 P 100), which is the number of data sets that follow. Each data set should be processed identically and independently.
Each data set consists of 1 line of input. The line contains the data set number, K, followed by the integer number of floors in the building, N, (1 <= N <= 25), followed by a positive 32-bit integer S, indicating the desired move number.
输出描述
For each data set there is a single line of output.
The output line consists of the data set number, K, followed by the minimum number of moves needed to swap the buildings, followed by the instructions for move S in the form: MOVE color FLOOR FROM LOT f TO LOT t, where color is either white or black, f is the starting lot number (1-4) and t is the destination lot number (1-4).
示例1
输入:
4 1 5 45 2 5 46 3 25 654321 4 25 654320
输出:
1 93 MOVE white FLOOR FROM LOT 3 to LOT 2 2 93 MOVE white FLOOR FROM LOT 1 to LOT 2 3 100663293 MOVE white FLOOR FROM LOT 3 to LOT 2 4 100663293 MOVE white FLOOR FROM LOT 3 to LOT 1