https://www.luogu.org/problemnew/show/P1002
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
using namespace std;
typedef long long ll;
const int N=10000;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m;
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
ll n,m,x,y,a[21][21],bx,by,b[21][21];
int dx[]={2,2,1,-1,-2,-2,-1,1};
int dy[]={-1,1,2,2,1,-1,-2,-2};
while(scanf("%lld%lld%lld%lld",&n,&m,&x,&y)!=EOF)
{
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
for(int i=0;i<8;i++)
{
bx=x+dx[i];
by=y+dy[i];
if(bx>=0&&by>=0&&bx<=20&&by<=20)
b[bx][by]=1;
}
b[x][y]=1;
for(int i=0;i<=n;i++)
{
for(int j=0;j<=m;j++)
{
if(b[i][j]) continue;
ll cnt=0;
if(i>=1 && !b[i-1][j]) cnt+=a[i-1][j];
if(j>=1 && !b[i][j-1]) cnt+=a[i][j-1];
a[i][j]=cnt;
if(i==0 && j==0) a[0][0]=1;
// printf("%lld",a[i][j]);
}
//printf("\n");
}
printf("%lld\n",a[n][m]);
}
//cout << "Hello world!" << endl;
return 0;
}