#include<iostream>
using namespace std;
bool a[10][10];
bool b[10][10]={0};
int sx,sy,fx,fy,tx,ty;
const int xx[4]={0,0,1,-1};
const int yy[4]={-1,1,0,0};
int n,m,t,ans=0;
void dfs(int x,int y)
{
if(x<1||y<1||x>n||y>m)
{
return;
}
if(x==fx&&y==fy)
{
ans++;
return;
}
b[x][y]==true;
for(int i=0;i<=3;i++)
{
if(b[x+xx[i]][y+yy[i]]==false&&a[x+xx[i]][y+yy[i]]==true)
{
dfs(x+xx[i],y+yy[i]);
}
}
b[x][y]=false;
}
int main()
{
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
a[i][j]==true;
}
}
for(int i=1;i<=t;i++)
{
cin>>tx>>ty;
a[tx][ty]==false;
}
b[sx][sy]=true;
dfs(sx,sy);
cout<<ans;
return 0;
}
输了样例,但是输出0