#include //#include #define nl cout<<"\n" #define sz(x) (int)((x).size()) #define len(x) (x).length() #define all(a) (a).begin(),(a).end() #define rep(i,n) for( int i=0;i<(int)(n);i++) #define brep(i,n) for( int i=(n);i>=0;i-- ) #define repp(i,a,b) for( int i = (a); i < (b); i++ ) #define ll long long int #define pb push_back #define mp make_pair #define F first #define S second #define vi vector #define vll vector #define pii pair #define vpii vector > #define bits __builtin_popcountll #define mod 1000000007 #define test int tes; cin >> tes; while( tes-- > 0 ) #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define pv(x) cout<< #x<< " = "<<(x)<<"\n"; #define foreach(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) using namespace std; ll a,b,x,y,n,m,t,k,p,q; int G[201][201]; struct nn{ int x,y; nn(){} nn(int a,int b){x=a;y=b;} }; void disp(string ans[100001],int s) { rep(i,s+1) cout< Q; Q.push(nn(a,b)); while(!Q.empty()) { nn temp = Q.front(); Q.pop(); int I=temp.x,J=temp.y; // pv(I); // pv(J); nn pre = par[I][J]; if(G[pre.x][pre.y] + 1 < G[I][J]) { G[I][J] = G[pre.x][pre.y] + 1; } if(I==p and J==q) break; for( direction=0; direction<6 ;direction++) { i=I+M[direction].x,j=J+M[direction].y; if(i>=0&&i=0&&j st; int aa,bb; while(!(p==a and q==b)) { st.push(back_dir[p][q]); aa = par[p][q].x , bb = par[p][q].y; p = aa; q = bb; } while(!st.empty()) cout<>n>>a>>b>>p>>q; solve(); }