#include using namespace std; void printShortestPath(int n, int is, int js, int ie, int je) { // Print the distance along with the sequence of moves. // Print the distance along with the sequence of moves. int im,jm,s=0;int ki; int ar[2*n];int a=0; int flag=0; if(ie>is) im=ie-is; else im=is-ie; if(je>js) jm=je-js; else jm=js-je; s=im+jm; if(ie==is || js==je) { if(ie==is && je>js) ki=(je-js); else if(ie==is && jeis) ki=(ie-is); else if(je==js && iemx3) { mx3=ar[i]; pos=i; } } int ans=ar[pos]+ar[pos+1]; cout<is && je>js) { for(int i=0;ijs) { for(int i=0;iis && jeis && je==js) { for(int i=0;ijs && ie==is) { for(int i=0;i> 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; }