求助,样例都不对
#include<bits/stdc++.h>
using namespace std;
int n,m,t,sx,sy,fx,fy,ans = 0;
int mx[4] = {0,0,-1,1},my[4] = {-1,1,0,0};
int a[10][10];
void dfs(int x,int y){
if(x == fx && y == fy){
ans++;
return;
}
for(int i = 0; i < 4; i++){
int xx = x + mx[i];
int yy = y + my[i];
if(xx >= 1 && xx <= n && yy >= 1 && yy <= m && a[xx][yy] == 0){
dfs(xx,yy);
}
}
}
int main(){
cin >> n >> m >> t;
cin >> sx >> sy >> fx >> sy;
for(int i = 1; i <= t; i++){
int x,y;
cin >> x >> y;
a[x][y] = 1;
}
cout << ans;
return 0;
}