func_code_string: #include <bits/stdc++.h>   using namespace std;   int grid[101][101];   int canDoRowOperation(int r, int c) {     int m = 1000;     for (int j = 0; j < c; j++) m = min(m, grid[r][j]);     return m;   }   int canDoClmOperation(int r, int c) {     int m = 1000;     for (int i = 0; i < r; i++) m = min(m, grid[i][c]);     return m;   }   int main() {     int r, c;     scanf( %d %d , &r, &c);     for (int i = 0; i < r; i++) {       for (int j = 0; j < c; j++) {         scanf( %d , &grid[i][j]);       }     }     vector<string> r_c;     vector<int> vec_num;     if (r <= c) {       for (int i = 0; i < r; i++) {         int m = canDoRowOperation(i, c);         if (m) {           for (int j = 0; j < c; j++) grid[i][j] -= m;         }         for (int k = 0; k < m; k++) {           r_c.push_back( row );           vec_num.push_back(i + 1);         }       }       for (int j = 0; j < c; j++) {         int m = canDoClmOperation(r, j);         if (m) {           for (int i = 0; i < r; i++) grid[i][j] -= m;         }         for (int k = 0; k < m; k++) {           r_c.push_back( col );           vec_num.push_back(j + 1);         }       }     } else {       for (int j = 0; j < c; j++) {         int m = canDoClmOperation(r, j);         if (m) {           for (int i = 0; i < r; i++) grid[i][j] -= m;         }         for (int k = 0; k < m; k++) {           r_c.push_back( col );           vec_num.push_back(j + 1);         }       }       for (int i = 0; i < r; i++) {         int m = canDoRowOperation(i, c);         if (m) {           for (int j = 0; j < c; j++) grid[i][j] -= m;         }         for (int k = 0; k < m; k++) {           r_c.push_back( row );           vec_num.push_back(i + 1);         }       }     }     bool isPossible = true;     for (int i = 0; i < r; i++)       for (int j = 0; j < c; j++)         if (grid[i][j]) isPossible = false;     if (isPossible == false) {       cout << -1 << endl;     } else {       int sz = r_c.size();       cout << sz << endl;       for (int i = 0; i < sz; i++) cout << r_c[i] <<     << vec_num[i] << endl;     }     return 0;   }   