func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MX = 255;   int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};   char s[MX][MX];   long long tot[MX][MX];   int was[MX][MX];   int cur[MX][MX];   int main() {     int n, m, p, w;     scanf( %d %d %d %d , &n, &m, &p, &w);     for (int i = 1; i <= n; i++) {       scanf( %s , s[i]);       for (int j = m; j >= 1; j--) {         s[i][j] = s[i][j - 1];       }       s[i][0] =   0 ;     }     int cnt = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (s[i][j] >=  A  && s[i][j] <=  Z ) {           cnt++;           queue<pair<int, int> > q;           q.push(make_pair(i, j));           cur[i][j] = p * (s[i][j] -  A  + 1);           was[i][j] = cnt;           while (!q.empty()) {             int xx = q.front().first, yy = q.front().second;             q.pop();             tot[xx][yy] += cur[xx][yy];             for (int dir = 0; dir < 4; dir++) {               int nx = xx + dx[dir], ny = yy + dy[dir];               if (was[nx][ny] != cnt && cur[xx][yy] / 2 > 0 && s[nx][ny] !=  *  &&                   nx >= 1 && nx <= n && ny >= 1 && ny <= m) {                 was[nx][ny] = cnt;                 cur[nx][ny] = cur[xx][yy] / 2;                 q.push(make_pair(nx, ny));               }             }           }         }       }     }     int res = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (tot[i][j] > w) res++;       }     }     printf( %d n , res);   }   