func_code_string: #include <bits/stdc++.h>   using namespace std;   const long double eps = 1e-9;   const long long INF = 1ll << 61, Mo = 1e9 + 7;   int n, m, t, tu, tp, td;   int h[400][400];   int s[400][400], x[400][400], z[400][400], y[400][400];   set<pair<int, int> >::iterator ii;   inline int time(int h1, int h2) {     if (h1 == h2) return tp;     if (h1 < h2) return tu;     return td;   }   void init() {     scanf( %d%d%d , &n, &m, &t);     scanf( %d%d%d , &tp, &tu, &td);     int i, j;     for (i = 1; i <= n; i++)       for (j = 1; j <= m; j++) scanf( %d , &h[i][j]);     for (j = 1; j <= m; j++)       for (i = 2; i <= n; i++) {         x[i][j] = x[i - 1][j] + time(h[i - 1][j], h[i][j]);         s[i][j] = s[i - 1][j] + time(h[i][j], h[i - 1][j]);       }     for (i = 1; i <= n; i++)       for (j = 2; j <= m; j++) {         y[i][j] = y[i][j - 1] + time(h[i][j - 1], h[i][j]);         z[i][j] = z[i][j - 1] + time(h[i][j], h[i][j - 1]);       }   }   int main() {     int i, j, k, w, ux, uy, dx, dy;     init();     int ans = 2e9;     for (i = 1; i <= n; i++)       for (j = i + 2; j <= n; j++) {         vector<pair<int, int> > V;         set<pair<int, int> > U;         for (k = 3; k <= m; k++) {           V.push_back(pair<int, int>(y[i][k] + z[j][k] + x[j][k] - x[i][k], k));           U.insert(V.back());         }         for (k = 0; k < V.size(); k++) {           int tmp = t - (s[j][k + 1] - s[i][k + 1]) + (y[i][k + 1] + z[j][k + 1]);           ii = U.lower_bound(pair<int, int>(tmp, 0));           if (ii != U.end() && ii->first - tmp < ans) {             ans = ii->first - tmp;             ux = i;             uy = k + 1;             dx = j;             dy = ii->second;           }           if (ii != U.begin()) {             ii--;             if (tmp - ii->first < ans) {               ans = tmp - ii->first;               ux = i;               uy = k + 1;               dx = j;               dy = ii->second;             }           }           U.erase(V[k]);         }       }     printf( %d %d %d %d n , ux, uy, dx, dy);     return 0;   }   