测试数据6 6 3 3可以啊
#include<iostream>
#include<cstring>
using namespace std;
long long num=1,n,m,x,y;
bool cant[21][21];
void dfs(int a,int b)
{
bool ok=false;
if(a+1<=n&&!cant[a+1][b])
{
dfs(a+1,b);
ok=true;
}
if(b+1<=m&&!cant[a][b+1])
{
if(ok)num++;
dfs(a,b+1);
}
else if(a+1<n&&b+1<m)--num;
}
int main()
{
cin>>n>>m>>x>>y;
n+=2;
m+=2;
x+=2;
y+=2;
cant[x+1][y+2]=true;
cant[x+2][y+1]=true;
cant[x-2][y+1]=true;
cant[x+1][y-2]=true;
cant[x-1][y+2]=true;
cant[x+2][y-1]=true;
cant[x-2][y-1]=true;
cant[x-1][y-2]=true;
dfs(2,2);
cout<<num;
}