#include<bits/stdc++.h>
using namespace std;
int ans,bx[25],by[25];
int fx[4]={2,1,-1,-2};//初值
int fy[4]={1,2,2,1};
void a(int x,int y,int stip){
bx[stip]=x;
by[stip]=y;
if(x==4&&y==8){ //输出
ans++;
cout<<ans<<":";
for(int i=0;i<=stip;i++){
cout<<bx[i]<<","<<by[i];
if(i<stip) cout<<"->";
}
cout<<endl;
}
for(int i=0;i<4;i++){
int tx=x+fx[i];
int ty=y+fy[i];
if(tx>=0&&tx<=4&&ty>=1&&ty<=8){
a(tx,ty,stip+1); //走的通的话,继续走
}
}
}
int main(){
a(0,0,0);//调用函数
return 0;
}
/**************************************************************
Problem: 1362
User: linzihang
Language: C++
Result: Accepted
Time:4 ms
Memory:2072 kb
****************************************************************/