1642: 马的遍历

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:85 Solved:17

Description

中国象棋半张棋盘如图4(a)所示。马自左下角往右上角跳。今规定只许往右跳,不许往左跳。比如图4(a)中所示为一种跳行路线,并将所经路线打印出来。打印格式为:0,0->2,1->3,3->1,4->3,5->2,7->4,8

Input

Output

多行

每行为一条线路

例如:(部分数据)

1:  0,0-->2,1-->4,2-->3,4-->4,6-->2,7-->4,8
2:  0,0-->2,1-->4,2-->3,4-->1,5-->3,6-->4,8
3:  0,0-->2,1-->4,2-->3,4-->1,5-->2,7-->4,8
4:  0,0-->2,1-->4,2-->2,3-->4,4-->3,6-->4,8
5:  0,0-->2,1-->4,2-->2,3-->4,4-->2,5-->4,6-->2,7-->4,8
6:  0,0-->2,1-->4,2-->2,3-->4,4-->2,5-->0,6-->2,7-->4,8