Problem4252--【基础】卒的遍历

4252: 【基础】卒的遍历

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Submit

Description

在一张 n×m 的棋盘上(如 6 行 7列)的最左上角 (1,1)的位置有一个卒。该卒只能向下或者向右走,且卒采取的策略是先向下下边走到头就向右,请问从 (1,1)点走到 (n,m) 点可以怎样走,输出这些走法。


Input

两个整数 nm 代表棋盘大小(3n8,3m8

Output

卒的行走路线。

Sample Input Copy

3 3

Sample Output Copy

1:1,1->2,1->3,1->3,2->3,3
2:1,1->2,1->2,2->3,2->3,3
3:1,1->2,1->2,2->2,3->3,3
4:1,1->1,2->2,2->3,2->3,3
5:1,1->1,2->2,2->2,3->3,3
6:1,1->1,2->1,3->2,3->3,3

Source/Category