malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > ans;   int deg[400001];   int tot;   int flag;   int n, d, k;   int name() {     flag++;     return flag;   }   void f(int x, int curr) {     if (tot <= 0 or x == 0) return;     while (deg[curr] < k and tot > 0) {       if (tot <= 0) return;       int t = name();       ans.push_back({curr, t});       deg[t]++;       deg[curr]++;       tot--;       f(x - 1, t);     }   }   int main() {     cin >> n >> d >> k;     tot = n - 1;     if (k == 1) {       if (n == 2 and d == 1) {         printf( YES n );         printf( 1 2 n );       } else if (n == 1 and d == 0) {         printf( YES n );       } else {         printf( NO n );       }       return 0;     }     if (n < d + 1) {       printf( NO n );       return 0;     }     if (k == 2) {       if (n == d + 1) {         printf( YES n );         for (int i = 0; i < n - 1; ++i) {           printf( %d %d n , i + 1, i + 2);         }       } else         printf( NO n );       return 0;     }     for (int i = 0; i < d; ++i) {       ans.push_back({i + 1, i + 2});       deg[i + 1]++;       deg[i + 2]++;       tot--;     }     flag = d + 1;     for (int i = 2; i <= d; ++i) {       int temp = min(i - 1, d + 1 - i);       f(temp, i);     }     if (tot > 0) {       printf( NO n );       return 0;     }     printf( YES n );     for (auto i : ans) {       printf( %d %d n , i.first, i.second);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int N, M;   int w[401][401];   int last[401], K;   double P1[401], P2[401], mxp[402];   int main() {     scanf( %d%d , &N, &M);     for (int i = 1; i <= N; i++)       for (int j = 1; j <= N; j++) w[i][j] = i == j ? 0 : 1e9;     for (int i = 1; i <= M; i++) {       int a, b;       scanf( %d%d , &a, &b);       w[a][b] = w[b][a] = 1;     }     for (int k = 1; k <= N; k++)       for (int i = 1; i <= N; i++)         for (int j = 1; j <= N; j++) w[i][j] = min(w[i][j], w[i][k] + w[k][j]);     double ans = 0;     for (int i = 1; i <= N; i++) {       double now = 0;       for (int dist = 0; dist < N; dist++) {         vector<int> arr;         for (int j = 1; j <= N; j++)           if (w[i][j] == dist) {             arr.push_back(j);           }         if (!((int)(arr).size())) continue;         for (int j = 1; j <= N; j++) P1[j] = P2[j] = 0;         for (int t : arr) P1[t] = 1. / ((int)(arr).size());         vector<int> cand;         for (int t : arr) {           int deg = 0;           for (int j = 1; j <= N; j++)             if (w[t][j] == 1) deg++;           for (int j = 1; j <= N; j++)             if (w[t][j] == 1) P2[j] += P1[t] / deg, cand.push_back(j);         }         sort((cand).begin(), (cand).end());         cand.erase(unique((cand).begin(), (cand).end()), cand.end());         double mx = 1. / ((int)(arr).size());         for (int j = 1; j <= N; j++) {           ++K;           for (int k : cand) {             if (last[w[j][k]] < K || last[w[j][k]] == K && mxp[w[j][k]] < P2[k])               last[w[j][k]] = K, mxp[w[j][k]] = P2[k];           }           double now2 = 0;           ++K;           for (int k : cand) {             if (last[w[j][k]] == K) continue;             last[w[j][k]] = K;             now2 += mxp[w[j][k]];           }           mx = max(mx, now2);         }         now += mx * ((int)(arr).size()) / N;       }       ans = max(ans, now);     }     printf( %.9f n , ans);   }
#include <bits/stdc++.h>   bool FLAG = 1;   using namespace std;   const long long MOD = (long long)1e9 + 7, N = (long long)2e6 + 222;   const long long INF = (long long)1e18;   long long n, k, p[N], a[N], b[N], b1[N];   string s;   void clear() {     for (long long i = 1; i <= n; ++i) {       p[i] = a[i];     }   }   long long m;   void solve() {     cin >> n >> m;     long long mx = 0;     for (long long i = 1; i <= n; ++i) {       cin >> a[i];       mx = max(mx, a[i]);     }     for (long long i = 1; i <= n; ++i) {       cin >> b[i];     }     sort(b + 1, b + 1 + n);     for (long long i = 1; i <= n; ++i) {       b1[i] = b[i] + m;     }     long long mn = INF;     clear();     for (long long i = 1; i <= n; ++i) {       long long d;       if (b1[i] - mx >= 0) {         d = b1[i] - mx;         for (long long j = 1; j <= n; ++j) {           p[j] += d;           p[j] %= m;         }         sort(p + 1, p + 1 + n);         bool ok = 0;         for (long long j = 1; j <= n; ++j) {           if (p[j] != b[j]) ok = 1;         }         if (ok == 0) {           mn = min(mn, d);         }         clear();       }       if (b[i] - mx >= 0) {         d = b[i] - mx;         for (long long j = 1; j <= n; ++j) {           p[j] += d;           p[j] %= m;         }         sort(p + 1, p + 1 + n);         bool ok = 0;         for (long long j = 1; j <= n; ++j) {           if (p[j] != b[j]) ok = 1;         }         if (ok == 0) {           mn = min(mn, d);         }         clear();       }     }     cout << mn;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long t = 1;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct str {     int sum, poz;   };   str v[100000];   int cmp(str a, str b) {     if (a.sum == b.sum)       return a.poz < b.poz;     else       return a.sum > b.sum;   }   int main() {     int n, x;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       int s = 0;       for (int j = 1; j <= 4; j++) {         scanf( %d , &x);         s += x;       }       v[i] = {s, i};     }     sort(v + 1, v + n + 1, cmp);     for (int i = 1; i <= n; i++)       if (v[i].poz == 1) {         printf( %d , i);         return 0;       }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[2006];   int Gcd(int m, int n) {     if (n == 0) return m;     return Gcd(n, m % n);   }   int main() {     int n;     scanf( %d , &n);     int yi = 0;     int flag = 0;     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       if (a[i] == 1) yi++;     }     if (yi != 0) {       printf( %d n , n - yi);       return 0;     }     int min = 5000;     for (int i = 0; i < n; i++) {       int sum = 0, mod = a[i];       for (int j = i + 1; j < n; j++) {         mod = Gcd(mod, a[j]);         sum++;         if (mod == 1) {           flag = 1;           if (sum < min) min = sum;           break;         }       }     }     if (flag == 1)       printf( %d n , min + n - 1);     else       printf( -1 n );   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int x = (n + 3) / 4;       int p = n - x;       while (p--) cout <<  9 ;       while (x--) cout <<  8 ;       cout << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1000 * 1000 + 20;   int a[N], x[N], y[N], visited[N], h[N], mark[N], n, t = 0, dady[N];   vector<int> ans, adj[N];   void dfs_mark(int v) {     visited[v] = 1;     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0) {         dfs_mark(u);         mark[v] += mark[u];       }     }   }   void dfs(int v) {     visited[v] = 1;     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0 and mark[u] == 1) {         ans.push_back(u);         dfs(u);       }     }   }   void dfs_child(int v) {     visited[v] = 1;     if (adj[v].size() == 1 and v != 1) {       t++;     }     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0) {         dady[u] = v;         dfs_child(u);       }     }   }   void masir(int v) {     if (v != 1) {       ans.push_back(dady[v]);       masir(dady[v]);     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) {       int x, y;       cin >> x >> y;       adj[x].push_back(y);       adj[y].push_back(x);     }     dfs_child(1);     fill(visited, visited + n + 1, 0);     int c, l = 1;     ans.push_back(1);     for (int i = 0; i < t; i++) {       cin >> c;       fill(visited, visited + n + 1, 0);       fill(mark, mark + n + 1, 0);       mark[c] = 1;       dfs_mark(l);       fill(visited, visited + n + 1, 0);       dfs(l);       l = c;     }     masir(c);     if (ans.size() > 2 * n - 1) {       cout << -1;       return 0;     }     for (int i = 0; i < ans.size(); i++) {       cout << ans[i] <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x, y, counter = 0;     cin >> x >> y;     int m = max(x, y);     while (m != 6) {       m++;       counter++;     }     string arr[6] = { 1/6 ,  1/3 ,  1/2 ,  2/3 ,  5/6 ,  1/1 };     cout << arr[counter] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   pair<pair<double, double>, double> circ[3];   vector<pair<double, double> > points;   double eps = 0.0000001;   double dist(pair<double, double> x, pair<double, double> y) {     return sqrt((x.first - y.first) * (x.first - y.first) +                 (x.second - y.second) * (x.second - y.second));   }   bool add_intersections(int a, int b) {     pair<double, double> centrA = circ[a].first;     pair<double, double> centrB = circ[b].first;     double r1 = circ[a].second;     double r2 = circ[b].second;     double d = dist(centrA, centrB);     if (r2 + d + eps < r1 || r1 + d + eps < r2) {       return false;     }     if (d > r1 + r2 + eps) {       return false;     }     double cos = (r1 * r1 + d * d - r2 * r2) / (2 * r1 * d);     double sin = sqrt(1 - cos * cos);     pair<double, double> v =         make_pair(centrB.first - centrA.first, centrB.second - centrA.second);     pair<double, double> v_l =         make_pair(v.first * cos - v.second * sin, v.first * sin + v.second * cos);     pair<double, double> v_r =         make_pair(v.first * cos + v.second * sin, v.second * cos - v.first * sin);     double sc = r1 / d;     points.push_back(make_pair(centrA.first + (v_l.first * sc),                                centrA.second + (v_l.second * sc)));     points.push_back(make_pair(centrA.first + (v_r.first * sc),                                centrA.second + (v_r.second * sc)));     return true;   }   void remove_copies() {     vector<pair<double, double> > old = points;     points.clear();     for (int i = 0; i < old.size(); i++) {       bool unique = true;       for (int j = 0; j < points.size(); j++) {         if (dist(points[j], old[i]) < eps) {           unique = false;         }       }       if (unique) {         points.push_back(old[i]);       }     }   }   bool on_circle(int nr, pair<double, double> p) {     double d = dist(circ[nr].first, p);     return (d + eps > circ[nr].second && d < eps + circ[nr].second);   }   bool edge[3][3];   bool vis[3];   void dfs(int x) {     vis[x] = 1;     for (int i = 0; i < 3; i++) {       if (!vis[i] && edge[x][i]) {         dfs(i);       }     }   }   int main() {     int n;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> circ[i].first.first >> circ[i].first.second >> circ[i].second;     }     int spsk = 0;     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         if (add_intersections(i, j)) {           edge[i][j] = 1;           edge[j][i] = 1;         }       }     }     for (int i = 0; i < n; i++) {       if (!vis[i]) {         spsk++;         dfs(i);       }     }     remove_copies();     int e = 0;     for (int i = 0; i < n; i++) {       e++;       for (int j = 0; j < points.size(); j++) {         if (on_circle(i, points[j])) {           e++;         }       }     }     cout << 2 + e - points.size() - n + spsk - 1 <<   n ;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimization( unroll-loops )   using namespace std;   const long long MAXN = 1e+5 + 7;   const long long MOD = 1e+9 + 7;   const long long INF = 0x7f7f7f7f7f7f7f7f;   const int INFi = 0x7f7f7f7f;   vector<long long> adj[MAXN];   long long visit[MAXN] = {};   int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};   int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};   long long n, t;   long long a[MAXN];   long long pre[MAXN];   long long res = -INF;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cout << fixed;     cout << setprecision(10);     ;     memset(pre, 0, sizeof(pre));     cin >> n >> t;     for (long long i = (1); i <= n; i++) cin >> a[i];     a[n + 1] = INF;     pre[1] = a[1];     for (long long i = (2); i <= n; i++) pre[i] = pre[i - 1] + a[i];     for (long long i = (1); i <= n; i++) {       long long ind =           upper_bound(pre + i, pre + n + 1, pre[i - 1] + t) - (pre + i);       res = max(res, ind);     }     cout << res;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int a[1000 + 10][1000 + 10];   bitset<1024> bs[1000 + 10], temp;   bool testAns(int ans) {     for (int(i) = (0), _n = (n - 1); (i) <= _n; (i)++) {       for (int(j) = (0), _n = (m - 1); (j) <= _n; (j)++) {         if (a[i][j] >= ans)           bs[i].set(j, true);         else           bs[i].set(j, false);       }     }     for (int(i) = (0), _n = (n - 1); (i) <= _n; (i)++) {       if (bs[i].count() < 2) continue;       for (int(j) = (i + 1), _n = (n - 1); (j) <= _n; (j)++) {         temp = bs[i] & bs[j];         if (temp.count() >= 2) return true;       }     }     return false;   }   int solve(int right) {     int left = 0;     int mid, ret = 0;     while (left <= right) {       mid = (left + right) / 2;       if (testAns(mid)) {         ret = mid;         left = mid + 1;       } else {         right = mid - 1;       }     }     return ret;   }   int main() {     int maxs = 0;     scanf( %d %d , &n, &m);     for (int(i) = (0), _n = (n - 1); (i) <= _n; (i)++) {       for (int(j) = (0), _n = (m - 1); (j) <= _n; (j)++) {         scanf( %d , &a[i][j]);         maxs = max(maxs, a[i][j]);       }     }     printf( %d n , solve(maxs));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int t, n, m;   long long ans;   int main() {     scanf( %d%d , &n, &m);     if (n == 1)       ans = m;     else if (m == 1)       ans = n;     else if (n == 2)       ans = ((m / 4) * 2 + min(m & 3, 2)) * 2ll;     else if (m == 2)       ans = ((n / 4) * 2 + min(n & 3, 2)) * 2ll;     else       ans = (n * 1ll * m + 1) / 2;     printf( %I64d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int n;     cin >> n;     string a, b;     vector<long long int> v1, v2;     for (long long int i = 0; i < n; i++) {       long long int x, y;       cin >> x >> y;       v1.push_back(x);       v2.push_back(y);       a +=  0 ;       b +=  0 ;     }     long long int i = 0, j = 0;     while ((i + j) != n) {       if (v1[i] <= v2[j])         a[i] =  1 , i++;       else         b[j] =  1 , j++;     }     for (long long int i = 0; i < n / 2; i++) {       a[i] =  1 ;       b[i] =  1 ;     }     cout << a << endl << b;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, ans = 99999;     int arr[102], tmp[102];     cin >> n;     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     for (int i = 1; i < n - 1; i++) {       int cnt = 0;       for (int j = 0; j < n; j++) {         if (j != i) tmp[cnt++] = arr[j];       }       int mx = -1;       for (int j = 1; j < n - 1; j++) mx = max(mx, tmp[j] - tmp[j - 1]);       ans = min(ans, mx);     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long mod = 1e9 + 7;   long long rev2 = (mod + 1) / 2;   long long mas[300300];   long long pow2[300300];   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %lld , &mas[i]);     sort(mas, mas + n);     pow2[0] = 1;     for (int i = 1; i < 300300; i++) pow2[i] = (pow2[i - 1] * 2LL) % mod;     for (int i = 1; i < n; i++) {       mas[i] -= mas[0];     }     mas[0] = 0;     long long sum = 0;     long long mn = 1;     for (int i = 1; i < n; i++) {       sum += mas[i] * mn;       sum %= mod;       mn *= 2;       mn %= mod;     }     long long res = 0;     for (int i = 1; i < n; i++) {       res += sum;       res %= mod;       sum -= (mas[i] - mas[i - 1]);       sum %= mod;       if (sum < 0) sum += mod;       sum *= rev2;       sum %= mod;       sum -= (long long)(pow2[n - i - 1] - 1) * (mas[i] - mas[i - 1]);       sum %= mod;       if (sum < 0) sum += mod;     }     printf( %lld , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e3 + 10;   const int mod = 1e9 + 7;   int read() {     int x = 0, f = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) f = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) x = (x << 1) + (x << 3) + c -  0 , c = getchar();     return x * f;   }   int inc(int x, int y) { return (x + y >= mod) ? (x + y - mod) : (x + y); }   int del(int x, int y) { return (x - y < 0) ? (x - y + mod) : (x - y); }   namespace math {   int qpow(int a, int x, int mo) {     int res = 1;     while (x) {       if (x & 1) res = 1ll * res * a % mod;       a = 1ll * a * a % mod;       x >>= 1;     }     return res;   }   int Fac[N], invFac[N];   void Finit(int n) {     Fac[0] = 1;     invFac[0] = 1;     for (int i = 1; i <= n; i++) Fac[i] = 1ll * Fac[i - 1] * i % mod;     invFac[n] = qpow(Fac[n], mod - 2, mod);     for (int i = n - 1; i >= 1; i--)       invFac[i] = 1ll * invFac[i + 1] * (i + 1) % mod;   }   int C(int n, int m) {     if (m == 0) return 1;     if (n < m || m < 0) return 0;     return (int)(1ll * Fac[n] * invFac[m] % mod * invFac[n - m] % mod);   }   }  // namespace math   bitset<N> p[N];   int c[N][N];   int main() {     int n = read(), m = read(), R = read();     int siz = 1e3;     math::Finit(n);     vector<int> X(n + 1), Y(n + 1), Z(n + 1);     for (int i = 1; i <= n; i++) X[i] = read(), Y[i] = read(), Z[i] = read();     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++)         if (max(abs(X[i] - X[j]), abs(Y[i] - Y[j])) <= R) p[i].set(j);     }     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++) {         c[i][j] = math::C(n - (p[i] | p[j]).count(), m);       }     }     int res = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++) {         int o = inc(del(del(math::C(n, m), c[i][i]), c[j][j]), c[i][j]);         res = inc(res, 1ll * o * Z[i] % mod * Z[j] % mod);       }     }     cout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   vector<int>::iterator IntIter;   vector<long long>::iterator LLIter;   int main(int argc, char *argv[]) {     int i, j;     int a[3][3];     for (i = 0; i < 3; i++)       for (j = 0; j < 3; j++) cin >> a[i][j];     int b[3][3] = {1};     b[0][0] = (a[0][0] + a[0][1] + a[1][0]) % 2;     b[0][1] = (a[0][0] + a[0][1] + a[0][2] + a[1][1]) % 2;     b[0][2] = (a[0][1] + a[0][2] + a[1][2]) % 2;     b[1][0] = (a[1][0] + a[0][0] + a[1][1] + a[2][0]) % 2;     b[1][1] = (a[1][0] + a[1][1] + a[1][2] + a[0][1] + a[2][1]) % 2;     b[1][2] = (a[1][1] + a[1][2] + a[0][2] + a[2][2]) % 2;     b[2][0] = (a[2][0] + a[1][0] + a[2][1]) % 2;     b[2][1] = (a[1][1] + a[2][0] + a[2][1] + a[2][2]) % 2;     b[2][2] = (a[1][2] + a[2][1] + a[2][2]) % 2;     for (i = 0; i < 3; i++) {       for (j = 0; j < 3; j++) {         if (b[i][j]) {           cout <<  0 ;         } else {           cout <<  1 ;         }       }       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char arr[31][31];   int n, m, x;   int main() {     ios_base::sync_with_stdio(0);     cout.tie(0);     cin.tie(0);     srand(time(NULL));     cin >> n >> m >> x;     map<char, int> m1;     vector<pair<float, float> > v;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cin >> arr[i][j];         m1[arr[i][j]]++;         if (arr[i][j] ==  S ) v.push_back(make_pair(i, j));       }     }     int q;     cin >> q;     string s;     cin >> s;     for (int i = 0; i < s.size(); i++) {       if (s[i] >= 65 && s[i] < 91 && !m1[ S ] ||           !m1[s[i]] && s[i] >= 97 && s[i] < 123 || s[i] ==  S  && !m1[ s ]) {         cout <<  -1 ;         return 0;       }     }     int q1 = 0;     map<char, int> ss;     for (int i = 0; i < s.size(); i++) {       int ans = 1000;       if (s[i] >= 65 && s[i] < 91) {         if (ss[s[i]] == 2)           q1++;         else if (ss[s[i]] == 1)           continue;         else {           s[i] += 32;           bool f = 0;           if (!m1[s[i]]) {             cout << -1 << endl;             return 0;           }           for (int j = 0; j < n; j++) {             for (int k = 0; k < m; k++) {               if (arr[j][k] == s[i]) {                 for (int l = 0; l < v.size(); l++) {                   if ((v[l].first - j) * (v[l].first - j) +                           (v[l].second - k) * (v[l].second - k) <=                       x * x) {                     f = 1;                     break;                   }                 }               }             }           }           if (!f) {             q1++;             ss[s[i] - 32] = 2;           } else             ss[s[i] - 32] = 1;         }       }     }     cout << q1 << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n;     cin >> n;     string s;     cin >> s;     long long ans = 0;     for (long long i = 0; i < n; i++) {       long long t = s[i] -  0 ;       if (t % 2 == 0) {         ans += i + 1;       }     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k, dotx, doty;   char t[502][502];   int vis[502][502];   int x[4] = {0, -1, 0, 1};   int y[4] = {1, 0, -1, 0};   void dfs(int r, int c) {     if (r >= n || r < 0 || c >= m || c < 0 || t[r][c] ==  #  || vis[r][c]) return;     vis[r][c] = 1;     for (int i = 0; i < 4; i++) {       dfs(r + x[i], c + y[i]);     }     if (k > 0) {       k--;       t[r][c] =  X ;     }   }   int main() {     cin >> n >> m >> k;     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) {         cin >> t[i][j];         if (t[i][j] ==  . ) {           dotx = i;           doty = j;         }       }     dfs(dotx, doty);     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cout << t[i][j];       }       cout <<   n ;     }   }