func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long long int n, s, min, max, l, r;     cin >> n;     s = pow(n, 2);     long long int v[s + 1];     for (long long int i = 0; i < s; i++) {       v[i] = i + 1;     }     for (long long int i = 0; i < n; i++) {       l = i;       r = n - 1;       if (n % 2 == 0) {         for (long long int j = 1; j <= n; j++) {           if (j <= n / 2) {             min = *min_element(v + l, v + r);             cout << min <<    ;             l = l + n;             r = r + n;           }           if (j > n / 2) {             max = *max_element(v + l - i, v + r - i + 1);             cout << max <<    ;             l = l + n;             r = r + n;           }         }       }       if (n % 2 != 0) {         for (long long int j = 1; j <= n; j++) {           if (j <= (n / 2) + 1) {             min = *min_element(v + l, v + r);             cout << min <<    ;             l = l + n;             r = r + n;           }           if (j > (n / 2) + 1) {             max = *max_element(v + l - i, v + r - i + 1);             cout << max <<    ;             l = l + n;             r = r + n;           }         }       }       cout << endl;     }     return 0;   }   