#include #include using namespace std; struct point { int x; int y; vectorpath; //int distance; }; bool isvalid(point temp,int n) { if(temp.x=0&&temp.y>=0) { return 1; } else return 0; } void printPath(vectorv) { for (auto i = v.begin(); i != v.end(); ++i) cout <<*i<<" " ; } void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { queue q; vector path; path.push_back(""); int flag=0; point source,destination; source.x=i_start; source.y=j_start; //source.distance=0 //source.path=path; path.pop_back(); destination.x=i_end; destination.y=j_end; q.push(source); int moves; bool visited[n][n]; memset(visited, false, sizeof visited); visited[source.x][source.y] = true; while(!q.empty()) { point point1=q.front(); q.pop(); path=point1.path; if (point1.x==destination.x&&point1.y==destination.y) { cout<> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }