输入描述:
Input consists of three lines, each line representing one peg of a Tower of Hanoi configuration. Each of these lines starts with a non-negative integer m indicating the number of disks on that peg, followed by m integers indicating the disks, starting with the disk on the bottom of the peg. The first line refers to the start peg and the last line refers to the destination peg. Disks are numbered consecutively starting at 1 with each number indicating the disk’s radius. All disk numbers used form a consecutive sequence. The maximum number of disks in any test case is 50.
输出描述:
Display No if the given configuration is not in the optimal solution sequence; otherwise display the minimum number of remaining moves required to get to the final configuration.