408972: GYM103401 A 15 Puzzle
Description
The 15 puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and many others) is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The puzzle also exists in other sizes, particularly the smaller 8 puzzle. If the size is $$$3 \times 3$$$ tiles, the puzzle is called the $$$8$$$ puzzle or $$$9$$$ puzzle, and if $$$4 \times 4$$$ tiles, the puzzle is called the $$$15$$$ puzzle or $$$16$$$ puzzle named, respectively, for the number of tiles and the number of spaces. The goal of the puzzle is to place the tiles in order by making sliding moves that use the empty space.
Here is some pictures for better understanding.
This picture is the final state of the game.
This picture is a condition that you can not solve it.
This picture is a shuffle of game.
So your target is to solve a shuffled 15 puzzle. You can use 'U','D','L','R' to move tiles.
'U' means move the tile under the empty space up to the empty space.
'D' means move the tile above the empty space down to the empty space.
'L' means move the tile on the right side of the empty space left to the empty space.
'R' means move the tile on the left side of the empty space right to the empty space.
Now you can use these letters to represent your solution. But it may not have a solution, just print "No".
Input$$$4$$$ lines, each line has $$$4$$$ numbers, represent the 15 puzzle game.
The numbers between $$$1$$$ to $$$15$$$ means the tiles with number and $$$0$$$ means the empty space.
OutputPrint "No" if there is no solution (without quotes).
Print "Yes" in the first line if there are solutions (without quotes). Then output the length of your solution and your solution in the second and the third line. Meanwhile, the length of your solution should not exceed $$$2000$$$.
ExamplesInput1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 15Output
Yes 1 LInput
1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 0Output
No