#include using namespace std; #define int long long signed main(){ int H,W; cin>>H>>W; H -= 2; vector> A(H,vector(W)); for(int i=0;i>A[i][j]; if(A[i][j] == -1) A[i][j] = 1e18; } vector>> G(H*W); vector dist(H*W,1e18); for(int i=0;i,vector>,greater>> pq; for(int i=0;i