problem
solution
codes
#include<iostream>
using namespace std;
typedef long long LL;
LL n, m, x1, y1, x2, y2, f[55][55];
int main(){
cin>>n>>m>>x1>>y1>>x2>>y2;
f[x1][y1] = 1;
for(int i = x1+1; i <= x2; i++)
for(int j = 1; j <= n; j++)
f[i][j] = f[i-1][j-2]+f[i-1][j+2]+f[i-2][j-1]+f[i-2][j+1];
cout<<f[x2][y2]<<"
";
return 0;
}
#include<iostream>
using namespace std;
typedef long long LL;
LL n, m, x1, y1, x2, y2, f[55][55];
int main(){
cin>>n>>m>>x1>>y1>>x2>>y2;
f[y1][x1] = 1;
for(int i = x1; i <= x2; i++){
for(int j = 1; j <= m; j++){
if(!f[j][i])continue;
f[j+1][i+2] += f[j][i];
f[j-1][i+2] += f[j][i];
f[j+2][i+1] += f[j][i];
f[j-2][i+1] += f[j][i];
}
}
cout<<f[y2][x2]<<"
";
return 0;
}