#include<bits/stdc++.h>
using namespace std;
int ans = 0;
int bx[25], by[25];
int lx[4] = {2, 1, -1, -2};
int ly[4] = {1, 2, 2, 1};
void YWN(int x, int y, int sum)
{
bx[sum] = x;
by[sum] = y;
if(x == 4 && y == 8)
{
ans++;
cout << ans << ":";
for(int i = 0; i <= sum; i++)
{
cout << bx[i] << "," << by[i];
if(i < sum)
{
cout << "->";
}
}
cout << endl;
return;
}
for(int i = 0; i < 4; i++)
{
int px = x + lx[i];
int py = y + ly[i];
if(px >= 0 && px <= 4 && py >= 0 && py <= 8)
{
YWN(px, py, sum + 1);
}
}
}
int main()
{
YWN(0, 0, 0);
return 0;
}
/**************************************************************
Problem: 1362
User: yangwanning
Language: C++
Result: Accepted
Time:4 ms
Memory:2072 kb
****************************************************************/