func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937_64 rnd(time(NULL));   const int N = 25;   const int inf = 1e9;   const double MAX_T = 1000;   const double MIN_T = 1e-5;   const int max_mutations = 10;   int n, m;   vector<int> A, B;   vector<vector<int> > best_ans, cur_ans;   int best_cost = 0;   inline void mutation(vector<vector<int> > &a) {     int cnt = rnd() % max_mutations + 1;     for (; cnt; cnt--) {       int x = rnd() % n, y = rnd() % m;       a[x][y] = rnd() % 2;     }   }   inline int calc(vector<vector<int> > &a) {     int x = 0, res = 0;     for (int i = 0; i < n; i++) {       x = 0;       for (int j = 0; j < m; j++) {         if (a[i][j] == 1 && (j == 0 || a[i][j - 1] == 0)) x++;       }       res += (x - A[i]) * (x - A[i]);     }     for (int i = 0; i < m; i++) {       x = 0;       for (int j = 0; j < n; j++) {         if (a[j][i] == 1 && (j == 0 || a[j - 1][i] == 0)) x++;       }       res += (x - B[i]) * (x - B[i]);     }     return res;   }   inline double ok(double E, double t) { return exp(-E / t); }   inline bool valid(double E, double t) {     if (E < 0) return true;     double x = ok(E, t);     x *= inf;     return (rnd() % inf <= x);   }   int main() {     ios_base ::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     A.resize(n, 0);     B.resize(m, 0);     for (int i = 0; i < n; i++) cin >> A[i];     for (int j = 0; j < m; j++) cin >> B[j];     cur_ans.assign(n, vector<int>(m));     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) cur_ans[i][j] = rnd() % 2;     best_ans = cur_ans;     best_cost = calc(cur_ans);     double T = MAX_T;     int i = 1;     while (T > MIN_T && best_cost != 0) {       mutation(cur_ans);       int cur_cost = calc(cur_ans);       if (valid(cur_cost - best_cost, T)) {         best_cost = min(best_cost, cur_cost);         if (best_cost == cur_cost) best_ans = cur_ans;       } else         cur_ans = best_ans;       T = MAX_T * 0.1 / i;       i++;     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (best_ans[i][j])           cout <<  * ;         else           cout <<  . ;       }       cout <<   n ;     }     return 0;   }   