func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, q;   int x[1000][1000];   int r[1000][1000][4];   void upd1(int j) {     int i = 0;     for (int k = 0; k < n; ++k) {       if (x[k][j] == 0) {         i = k + 1;         r[k][j][0] = -1;       } else         r[k][j][0] = i;     }     i = n - 1;     for (int k = n - 1; k > -1; --k) {       if (x[k][j] == 0) {         i = k - 1;         r[k][j][1] = -1;       } else         r[k][j][1] = i;     }   }   void upd2(int i) {     int j = 0;     for (int k = 0; k < m; ++k) {       if (x[i][k] == 0) {         j = k + 1;         r[i][k][2] = -1;       } else         r[i][k][2] = j;     }     j = m - 1;     for (int k = m - 1; k > -1; --k) {       if (x[i][k] == 0) {         j = k - 1;         r[i][k][3] = -1;       } else         r[i][k][3] = j;     }   }   int main() {     cin.sync_with_stdio(false);     cin >> n >> m >> q;     for (int i = 0; i < n; ++i)       for (int j = 0; j < m; ++j) cin >> x[i][j];     for (int j = 0; j < m; ++j) upd1(j);     for (int i = 0; i < n; ++i) upd2(i);     for (int k = 0; k < q; ++k) {       int op;       int i, j;       cin >> op;       cin >> i >> j;       i--;       j--;       if (op == 1) {         x[i][j] = 1 - x[i][j];         upd1(j);         upd2(i);       } else {         int res = 0;         if (x[i][j] != 0) {           int up = 0;           int down = n - 1;           for (int k = j; k <= r[i][j][3]; ++k) {             up = max(up, r[i][k][0]);             down = min(down, r[i][k][1]);             res = max(res, (down - up + 1) * (k - j + 1));           }           up = 0;           down = n - 1;           for (int k = j; k >= r[i][j][2]; --k) {             up = max(up, r[i][k][0]);             down = min(down, r[i][k][1]);             res = max(res, (down - up + 1) * (j - k + 1));           }           int left = 0;           int right = m - 1;           for (int k = i; k <= r[i][j][1]; ++k) {             left = max(left, r[k][j][2]);             right = min(right, r[k][j][3]);             res = max(res, (right - left + 1) * (k - i + 1));           }           left = 0;           right = m - 1;           for (int k = i; k >= r[i][j][0]; --k) {             left = max(left, r[k][j][2]);             right = min(right, r[k][j][3]);             res = max(res, (right - left + 1) * (i - k + 1));           }         }         cout << res << endl;       }     }     return 0;   }   