#include using namespace std; int main(){ int n, m, t; cin>>n>>m>>t; vector>p(n, vector(m)); for(int i=0;i>p[i][j]; } } int x1, y1, x2, y2; cin>>x1>>y1>>x2>>y2; x1--, y1--, x2--, y2--; vectordx = {0, 1, 0, -1}; vectordy = {1, 0, -1, 0}; const int inf = 1e9; vector>dist(n, vector(m, inf)); priority_queue>, vector>>, greater>>>pq; dist[x1][y1] = 0; pq.push({0, {x1, y1}}); while(!pq.empty()){ auto [d, id] = pq.top(); pq.pop(); auto [x, y] = id; if(dist[x][y] < d || p[x][y] == -1) continue; for(int k=0;k<4;k++){ int nx = x + dx[k]; int ny = y + dy[k]; if(nx < 0 || nx >= n || ny < 0 || ny >= m) continue; int nd = d + p[x][y]; if(nd < dist[nx][ny]){ dist[nx][ny] = nd; pq.push({nd, {nx, ny}}); } } } int ans = t / dist[x2][y2]; cout<