#include using namespace std; typedef long long int ll; #define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout< ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout< ostream& operator <<(ostream &o,const pair p){o<<"("<>h>>w;cin.ignore(); for (i=0;i> q; q.push(vector{0,sx,sy,0}); dp[sx][sy][0]=1; int x,y,cnt,job,tx,ty;int ddd=0; while (!q.empty()){ const vector &qfront = q.front(); cnt=qfront[0]+1;x=qfront[1];y=qfront[2];job=qfront[3]; q.pop(); if (maze[y][x]=='G'){ cout<<(cnt-1)<{cnt,tx,ty,job}); } } } cout<<-1<