#include<fstream>
#include<iostream>
//#define debug
#define maxn 20
#define maxm 20
using namespace std;
#define fin cin
#define fout cout
//ifstream fin ("NOIPC4.in");
//ofstream fout ("NOIPC4.out");
#ifdef debug
ofstream deb ("debug.log");
#endif
bool chessboard[maxn+1][maxm+1]={true};
long long blank[maxn+1][maxm+1]={0};
int n,m,x,y;
bool isok(int a,int b){
if (a>=0&&a<=n&&b>=0&&b<=m) return true;
return false;
}
void input_init(){
fin>>n>>m>>x>>y;
memset(chessboard,true,sizeof(chessboard));
memset(blank,0,sizeof(blank));
if (isok(x,y))chessboard[x][y]=false;
if (isok(x-1,y+2))chessboard[x-1][y+2]=false;
if (isok(x-2,y+1))chessboard[x-2][y+1]=false;
if (isok(x-2,y-1))chessboard[x-2][y-1]=false;
if (isok(x-1,y-2))chessboard[x-1][y-2]=false;
if (isok(x+1,y-2))chessboard[x+1][y-2]=false;
if (isok(x+2,y-1))chessboard[x+2][y-1]=false;
if (isok(x+2,y+1))chessboard[x+2][y+1]=false;
if (isok(x+1,y+2))chessboard[x+1][y+2]=false;
if (chessboard[0][0]) blank[0][0]=1;
else blank[0][0]=0;
for (int i=1;i<=n;i++)
if (chessboard[i][0])
blank[i][0]=blank[i-1][0];
else blank[i][0]=0;
for (int j=1;j<=m;j++)
if (chessboard[0][j])
blank[0][j]=blank[0][j-1];
else blank[0][j]=0;
}
void work(){
for (int i=1;i<=n;i++)
for (int j=1;j<=m;j++)
{
if (chessboard[i][j])
blank[i][j]=blank[i-1][j]+blank[i][j-1];
else blank[i][j]=0;
}
#ifdef debug
deb<<’\t’;
for (int j=0;j<=n;j++)
deb<<j<<’\t’;
deb<<endl;
for (int i=0;i<=n;i++){
deb<<i<<’\t’;
for (int j=0;j<=m;j++)
deb<<blank[i][j]<<’\t’;
deb<<endl;
}
#endif
}
void output(){
fout<<blank[n][m];
}
int main(void){
input_init();
work();
output();
// while(1);
return 0;
}
program p69(input, output);
var
n, m, x, y, i, j: longint;
map: array [-10..30, -10..30] of boolean;
dp: array [-1..20, -1..20] of int64;
begin
fillchar(map, sizeof(map), 0);
fillchar(dp, sizeof(dp), 0);
readln(n, m, x, y);
map[x, y] := true;
map[x - 2, y - 1] := true;
map[x - 1, y - 2] := true;
map[x - 2, y + 1] := true;
map[x - 1, y + 2] := true;
map[x + 1, y + 2] := true;
map[x + 2, y + 1] := true;
map[x + 1, y - 2] := true;
map[x + 2, y - 1] := true;
dp[-1, 0] := 1;
for i := 0 to n do
for j := 0 to m do
if not map[i, j] then
dp[i, j] := dp[i - 1, j] + dp[i, j - 1];
writeln(dp[n, m])
end.
#include <iostream>
#include <math.h>
using namespace std;
int n, m, x, y;
long long map[21][21];
bool safe(int a, int b)
{
return !((abs(a-x)*abs(b-y)==2) || (a==x && b == y));
}
int main()
{
cin >> n >> m >> x >> y;
map[0][0] = 1;
for (int i = 1; safe(i,0) && i<=n; i++)
map[i][0] = map[i-1][0];
for (int i = 1; safe(0,i) && i<=m; i++)
map[0][i] = map[0][i-1];
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
if (safe(i,j))
map[i][j] = map[i-1][j]+map[i][j-1];
cout << map[n][m];
return 0;
}