1 #include <algorithm>
2 #include <cstdio>
3
4 #define LL long long
5
6 using namespace std;
7
8 LL n,m,x1,y1,x2,y2;
9 LL f[55][55];
10
11 int main()
12 {
13 scanf("%lld%lld",&n,&m);
14 scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
15 f[x1][y1]=1;
16 for(int i=x1+1;i<=x2;i++)
17 for(int j=1;j<=m;j++)
18 f[i][j]=f[i-2][j-1]+f[i-2][j+1]+f[i-1][j-2]+f[i-1][j+2];
19 printf("%lld",f[x2][y2]);
20 return 0;
21 }