func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, x, frq, ans[25][25];   map<int, int> mp;   priority_queue<pair<int, int> > pq;   priority_queue<pair<int, set<pair<int, int> > > > mat;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 0; i < n * n; ++i) cin >> x, ++mp[x];     for (auto it : mp) pq.push({it.second, it.first});     for (int i = 0; i < (n + 1) / 2; ++i) {       for (int j = 0; j < (n + 1) / 2; ++j) {         set<pair<int, int> > temp;         temp.insert({i, j});         temp.insert({n - i - 1, j});         temp.insert({i, n - j - 1});         temp.insert({n - i - 1, n - j - 1});         mat.push({temp.size(), temp});       }     }     while (mat.size()) {       set<pair<int, int> > temp = mat.top().second;       x = pq.top().second, frq = pq.top().first, mat.pop(), pq.pop();       if (frq < temp.size()) return cout <<  NO , 0;       for (auto it : temp) ans[it.first][it.second] = x, --frq;       pq.push({frq, x});     }     cout <<  YES n ;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < n; ++j) cout << ans[i][j] <<    ;       cout <<   n ;     }     return 0;   }   