Problem M. Checkers
时间限制 1000 ms
内存限制 64 MB
Little X, Little Y and Little Z are playing checkers when Little Y is annoyed. So he wants to make the chessboard much bigger. Although Little Z insists the original version, Little X stands by Little Y. After they enlarge the chessboard, the chessboard turns to an infinite line.
The chessboard is like the Number Axes now, with each integer point able to hold a checker. At initial status there are three checkers on three different integer points , and through the game there always are three checkers. Every time, they can choose a checker A to jump across a pivot checker B to a new position(but the distance between old A and B equals to new A and B, and there should be no other checkers except B in the range [old A, new A]).
After playing for a while, they wonder whether an given status a,b,c can be transferred to x,y,z. obeying the rules. Since the checkers are considered the same, it is unnecessary for a must jump to x.
输入数据
输出数据
The first line is YES or NO, showing whether the transfer can be achieved.
If it is YES, then output the least steps in the second line.
样例输入
样例输出
样例说明
The middle checker jumps to position 0, and the status is 0 1 3 Then , the middle one jumps to 5.
$ Mathjax font initiator $