func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = 2e9;   const int mod = 1e9 + 7;   const int N = 1234;   int n, m;   long long k;   int a[N][N], h[N * N], p[N * N];   long long b[N][N];   bool used[N][N];   vector<pair<int, int> > go = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};   bool check(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; }   int get(int x) { return x == p[x] ? x : p[x] = get(p[x]); }   void unite(int x, int y) {     x = get(x);     y = get(y);     if (x == y) return;     p[x] = y;     h[y] += h[x];     h[x] = 0;   }   long long qwe;   void dfs(int i, int j) {     k -= qwe;     used[i][j] = true;     b[i][j] = qwe;     for (auto w : go) {       int x = i + w.first, y = j + w.second;       if (check(x, y) && !used[x][y] && k > 0ll && a[x][y] >= qwe) dfs(x, y);     }   }   int main() {     ios::sync_with_stdio(0);     cin >> n >> m >> k;     vector<pair<int, pair<int, int> > > v;     v.reserve(n * m);     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cin >> a[i][j];         p[i * m + j] = i * m + j;         h[i * m + j] = 1;         v.push_back({a[i][j], {i, j}});       }     }     sort(v.rbegin(), v.rend());     for (int i = 0; i < n * m; i++) {       int x = v[i].second.first, y = v[i].second.second, w = v[i].first;       for (auto z : go) {         int nx = x + z.first, ny = y + z.second;         if (check(nx, ny) && a[nx][ny] >= w) {           unite(x * m + y, nx * m + ny);         }       }       int sz = h[get(x * m + y)];       if (k % (long long)w == 0ll && k / (long long)w <= (long long)sz) {         qwe = w;         dfs(x, y);         cout <<  YES n ;         for (int j = 0; j < n; j++) {           for (int z = 0; z < m; z++) {             cout << b[j][z] <<    ;           }           cout <<   n ;         }         return 0;       }     }     cout <<  NO ;     return 0;   }   