#include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; const ll INF=9e18; int main() { ll H,W; cin>>H>>W; vector hai (H); for (ll a = 0; a < H; a++){ cin>>hai[a]; } queue>q; q.push({1,0,0}); ll count=0; while(1){ if(q.empty())break; ll jem=get<0>(q.front()); ll x=get<1>(q.front()); ll y=get<2>(q.front()); //cout<