func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2007;   int n, m, a[maxn][maxn];   long long sr[maxn][maxn], sc[maxn][maxn], sumr[maxn], sumc[maxn], allsumr[maxn],       allsumc[maxn];   int main() {     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         scanf( %d , &a[i][j]);         sumr[i] += a[i][j];         sumc[j] += a[i][j];       }     }     for (int r = 1; r <= n + 1; r++) {       for (int nr = 1; nr <= n; nr++) {         int dis;         if (nr < r)           dis = abs(r - nr - 1) * 4 + 2;         else           dis = abs(r - nr) * 4 + 2;         sr[r][nr] = dis * dis * sumr[nr];         allsumr[r] += sr[r][nr];       }     }     for (int c = 1; c <= m + 1; c++) {       for (int nc = 1; nc <= m; nc++) {         int dis;         if (nc < c)           dis = abs(c - nc - 1) * 4 + 2;         else           dis = abs(c - nc) * 4 + 2;         sc[c][nc] = dis * dis * sumc[nc];         allsumc[c] += sc[c][nc];       }     }     long long ans = 1e18 + 10;     int x, y;     for (int r = 1; r <= n + 1; r++) {       for (int c = 1; c <= m + 1; c++) {         if (allsumr[r] + allsumc[c] < ans) {           ans = allsumr[r] + allsumc[c];           x = r, y = c;         }       }     }     printf( %lld n%d %d n , ans, x - 1, y - 1);     return 0;   }   