#include #include using namespace std; #define MAX 202 struct node { int i; int j; }; int dir[4][2]={{1,0},{0,1},{-1,0},{0,-1}}; int martic[MAX][MAX]; int mark[MAX][MAX]; node queue[40004]; int bfs(int x,int y,int a,int b) { if(x==a&&y==b) return 0; node t