/* * USER: Raj Manvar * LANG: C++ * */ #include #include #define pb push_back #define mp make_pair #define f first #define s second #define DRT() int t; cin>>t; while(t--) #define TRACE #ifdef TRACE #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define trace5(a, b, c, d, e) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl; #define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl; #else #define trace1(x) #define trace2(x, y) #define trace3(x, y, z) #define trace4(a, b, c, d) #define trace5(a, b, c, d, e) #define trace6(a, b, c, d, e, f) #endif using namespace std; typedef long long int lli; int n; bool visited[205][205]; int ans[205][205]; bool func(lli x,lli y) { if (x>=0 && x=0 && y=0 && x=0 && y > > > q; vector mx = {-2,-2,0,2,2,0}; vector my = {-1,1,2,1,-1,-2}; vector pmx = {2,2,0,-2,-2,0}; vector pmy = {1,-1,-2,-1,1,2}; vector movestr = {"UL","UR","R","LR","LL","L"}; map,vector > ansmap; int main() { memset(visited,0,sizeof(visited)); memset(ans,-1,sizeof(ans)); cin>>n; lli sx,sy,ex,ey; cin>>sx>>sy>>ex>>ey; vector x; q.push_back(mp(sx,mp(sy,x))); visited[sx][sy]=1; while(q.size()!=0) { pair > > temp = q.front(); int px = temp.first; int py = temp.second.first; vector vstr = temp.second.second; ansmap[make_pair(px,py)]=vstr; q.pop_front(); ans[px][py]=vstr.size(); for (int i=0;i raj = ansmap[make_pair(ex,ey)]; cout<