测试点#3和#4 WA
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 25;
int n, m, cx, cy;
ll vis[maxn][maxn], mem[maxn][maxn];
int fx[2] = {1, 0}, fcx[8] = {-1, 1, -2, 2, 1, -1, 2, -2};
int fy[2] = {0, 1}, fcy[8] = {-2, 2, -1, 1, -2, 2, -1, 1};
bool bj(int x, int y) {
return (x >= 0 && x <= n && y >= 0 && y <= m);
}
int dfs(int x, int y) {
if (x == n && y == m) return 1;
if (mem[x][y] != -1) return mem[x][y];
ll sum = 0;
for (int i = 0; i < 2; i++) {
int nx = x + fx[i];
int ny = y + fy[i];
if (!vis[nx][ny] && bj(nx, ny)) {
vis[nx][ny] = 1;
sum += dfs(nx, ny);
vis[nx][ny] = 0;
}
}
return mem[x][y] = sum;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m >> cx >>cy;
memset(mem, -1, sizeof mem);
vis[cx][cy] = 1;
for (int i = 0; i < 8; i++) {
int nx = cx + fcx[i];
int ny = cy + fcy[i];
if (bj(nx, ny)) vis[nx][ny] = 1;
}
if (vis[0][0] || vis[n][m]) {
cout << 0;
return 0;
}
vis[0][0] = 1;
ll ans = dfs(0, 0);
cout << ans;
return 0;
}