malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     scanf( %d %d , &n, &k);     int a[500005];     map<int, vector<int>> m;     set<int> s;     for (int i = 0; i < n; i++) s.insert(i);     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       m[a[i]].push_back(i);     }     int llast = n + k;     int last = n;     int cnt = 0;     for (auto it : m) {       if (!cnt && it.second[0] < last - k) {         auto it = s.lower_bound(llast - k);         if (it != s.end()) last = *it;         cnt = 1;       }       if (it.second[0] < last - k) {         printf( NO n );         return 0;       }       for (auto it2 : it.second) {         s.erase(it2);       }       llast = last;       last = min(it.second[0], last);     }     printf( YES n );   }
#include <bits/stdc++.h>   using namespace std;   map<int, int> glosy;   map<pair<int, int>, int> parki;   int main() {     int n, m;     scanf( %d%d , &n, &m);     for (int i = (0); i < (n); i++) {       int a, b;       scanf( %d%d , &a, &b);       if (a > b) swap(a, b);       if (glosy.find(a) != glosy.end())         glosy[a]++;       else         glosy.insert(make_pair(a, 1));       if (glosy.find(b) != glosy.end())         glosy[b]++;       else         glosy.insert(make_pair(b, 1));       if (parki.find(make_pair(a, b)) != parki.end())         parki[make_pair(a, b)]++;       else         parki.insert(make_pair(make_pair(a, b), 1));     }     if (m == 0) {       cout << (n * 1LL * (n - 1LL)) / 2LL << endl;       return 0;     }     long long int res = 0LL;     vector<int> v;     for (map<int, int>::iterator it = glosy.begin(); it != glosy.end(); it++)       v.push_back(it->second);     int jeszcze = n - v.size();     sort(v.begin(), v.end());     int k = v.size();     for (int i = (0); i < (k); i++) {       vector<int>::iterator it2 = lower_bound(v.begin(), v.end(), m - v[i]);       int ile = (v.end() - it2);       if (v[i] + v[i] >= m) ile--;       if (v[i] >= m) ile += 2 * jeszcze;       res += ile * 1LL;     }     res = res / 2;     for (map<pair<int, int>, int>::iterator it = parki.begin(); it != parki.end();          it++) {       pair<int, int> para = it->first;       int a = para.first;       int b = para.second;       int x = glosy[a] + glosy[b] - it->second;       if (x < m && ((glosy[a] + glosy[b]) >= m)) res--;     }     cout << res << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 10;   vector<int> v;   set<pair<int, int> > st;   int bfs(int x) {     queue<int> q;     q.push(x);     int cnt = 0;     while (!q.empty()) {       int u = q.front();       q.pop();       cnt++;       int len = v.size();       for (int i = 0; i < len; i++, len = v.size()) {         int p = v[i];         if (st.find(make_pair(u, p)) != st.end())           continue;         else           swap(v[i], v.back()), v.pop_back(), q.push(p), i--;       }     }     return cnt;   }   int main() {     int n, m;     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       int u, v;       scanf( %d%d , &u, &v);       st.insert(make_pair(u, v));       st.insert(make_pair(v, u));     }     for (int i = 1; i <= n; i++) v.push_back(i);     int ans = 0;     while (!v.empty()) {       int x = v.back();       v.pop_back();       bfs(x);       ans++;     }     printf( %d n , ans - 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool essentiallyEqual(float a, float b) {     return fabs(a - b) <= ((fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * 1e-6);   }   struct TVector {     long long x, y;     TVector operator+(TVector q) const { return {x + q.x, y + q.y}; }     TVector operator-(TVector q) const { return {x - q.x, y - q.y}; }     TVector operator*(int t) const { return {x * t, y * t}; }     long long operator*(TVector q) const { return {x * q.x + y * q.y}; }     long long operator^(TVector q) const { return {x * q.y - q.x * y}; }     long double operator~() const { return {hypot(x, y)}; }     long double disPointLine(TVector p, TVector q) {       TVector r = *this;       if (((r - p) * (q - p) >= 0) && ((r - q) * (p - q) >= 0)) {         return abs((q - p) ^ (r - p)) / ~(p - q);       } else {         return min(~(r - p), ~(r - q));       }     }     bool onLine(TVector p, TVector q) {       TVector r = *this;       long double dis = r.disPointLine(p, q);       return essentiallyEqual(dis, 0);     }     long double sqrdDist(TVector p) {       return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);     }     int orientation(TVector b, TVector c) {       TVector a = *this;       int val = (c - a) ^ (b - a);       return val;     }     int orientationV2(TVector b, TVector c) {       TVector a = *this;       int val = (c - a) ^ (b - a);       if (val == 0) return 0;       return (val > 0) ? 1 : 2;     }     void imprimePonto() { printf( %lld %lld , x, y); }   };   vector<TVector> stormtroopers;   vector<int> isShot;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int n, x0, y0;     cin >> n >> x0 >> y0;     TVector gun;     gun.x = x0;     gun.y = y0;     for (int i = 0; i < n; ++i) {       int x, y;       cin >> x >> y;       stormtroopers.push_back({x, y});       isShot.push_back(0);     }     int tiros = 0;     for (int i = 0; i < n; ++i) {       if (!isShot[i]) {         tiros++;         for (int j = i + 1; j < n; ++j) {           if (!isShot[j]) {             if (!gun.orientationV2(stormtroopers[i], stormtroopers[j]))               isShot[j] = 1;           }         }       }     }     cout << tiros << endl;     return 0;   }
#include <vector>   #include <iostream>   #include <algorithm>   #include <string>   #include <cmath>   #include <map>   #define ll long long   using namespace std;         int main()   {       ll t;       cin >> t;       while (t--) {           ll n, m;           cin >> n >> m;           string s;           vector<ll> a(n, 0);           vector<ll> b(n, 0);           vector<ll> c(m, 0);           vector<ll> result(m, 0);           vector<vector<ll>> bucket(n + 1, vector<ll>(0));              for (auto& e : a)cin >> e;           for (auto& e : b)cin >> e;           for (auto& e : c)cin >> e;              for (ll i = 0; i < n; i++)           {               if (b[i] != a[i]) {                   bucket[b[i]].push_back(i);               }           }              ll lastC = -1;           if (bucket[c[m - 1]].size() > 0) {               lastC = bucket[c[m - 1]].back();               bucket[c[m - 1]].pop_back();           }           else {               for (ll i = 0; i < n; i++)               {                   if (b[i] == c[m - 1]) {                       lastC = i;                       break;                   }               }           }              if (lastC == -1) {               cout <<  NO  << endl;           }           else {               result[m - 1] = lastC;               for (ll i = 0; i < m - 1; i++)               {                   if (bucket[c[i]].size() == 0) {                       result[i] = lastC;                   }                   else {                       result[i] = bucket[c[i]].back();                       bucket[c[i]].pop_back();                   }               }                  auto res = true;               for (ll i = 0; i < n + 1; i++)               {                   if (bucket[i].size() > 0) {                       res = false;                   }               }                  if (res == false) {                   cout <<  NO  << endl;               }               else {                   cout <<  YES  << endl;                   for (ll i = 0; i < m; i++)                   {                       cout << result[i] + 1;                       if (i < m - 1) {                           cout <<    ;                       }                       else {                           cout << endl;                       }                   }               }           }       }       return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int nmax = 1010;   const int inf = 1000000007;   int n;   pair<int, int> a[nmax];   int main() {     ios_base::sync_with_stdio(false);     cin >> n;     for (int i = 1; i <= n; ++i) cin >> a[i].first >> a[i].second;     long double ans = 1e15;     a[n + 1] = a[1];     a[n + 2] = a[2];     for (int i = 1; i <= n; ++i) {       pair<int, int> a1 = a[i], a2 = a[i + 1], a3 = a[i + 2];       long double A = a3.second - a1.second, B = a1.first - a3.first,                   C = -A * a3.first - a3.second * B;       long double d =           abs(A * a2.first + B * a2.second + C) / (sqrt((A * A + B * B)));       if (ans > d) ans = d;     }     cout << fixed << setprecision(15) << ans / (long double)2.0 <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxn = 1e6 + 666;   long long saveori[maxn];   long long save[maxn];   long long getcnt(long long x) {     long long cnt = 0;     while (x) {       if (x & 1) cnt++;       x = x >> 1;     }     return cnt;   }   long long cnt[maxn][2];   long long pre[maxn];   signed main() {     long long n;     cin >> n;     for (long long i = 1; i <= n; i++) {       scanf( %lld , &saveori[i]);       save[i] = getcnt(saveori[i]);     }     long long sum = 0;     for (long long i = 1; i <= n; i++) {       cnt[i][0] = cnt[i - 1][0];       cnt[i][1] = cnt[i - 1][1];       cnt[i][sum % 2]++;       sum += save[i];       pre[i] = sum;     }     long long ans = 0;     for (long long i = n; i >= 1; i--) {       long long maxval = -1;       sum = 0;       for (long long j = i; j >= i - 64 && j > 0; j--) {         sum += save[j];         maxval = max(maxval, save[j]);         if (maxval * 2 <= sum && sum % 2 == 0) {           ans++;         }       }       if (i - 65 >= 1) {         ans += cnt[i - 65][pre[i] % 2];       }     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   #define int long long int   void next(char &x){       if(x<= b ){           x++;       }else{           x= a ;       }   }   void solve() {       int n,k;       cin>>n>>k;       char cur= a ;       for(int i=0;i<n;i++){           cout<<cur;           next(cur);       }       cout<<endl;   }   signed main() {       ios::sync_with_stdio(false);       cin.tie(nullptr);       cout.tie(nullptr);       int t;       cin >> t;       while (t--){           solve();       }   }
#include <bits/stdc++.h>   using namespace std;   int n, a[105], z, x;   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d , a + i);       if (a[i] % 2) x++;       z += a[i];     }     if (z % 2)       printf( %d , x);     else       printf( %d , n - x);   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1000005, mod = 1000000007;   vector<int> pri;   bool vis[80];   int pos[80], a[maxn], n;   long long w[80];   long long dp[1 << 21], dp2[1 << 21], f[maxn];   void prework() {     for (int i = 2; i < (71); ++i) {       if (!vis[i]) {         pri.push_back(i);         pos[i] = (int)pri.size() - 1;         for (int j = i; j <= 70; j += i) vis[j] = 1;       }     }     f[0] = 1;     for (int i = 1; i < (maxn); ++i) f[i] = 2 * f[i - 1] % mod;   }   void init() {     scanf( %d , &n);     for (int i = 0; i < (n); ++i) {       scanf( %d , &a[i]);       w[a[i]]++;     }   }   int gao(int n) {     int tmp[30] = {0};     for (int i = 2; i <= n; ++i) {       while (n % i == 0) {         n /= i;         tmp[pos[i]] ^= 1;       }     }     if (n > 1) tmp[pos[n]] ^= 1;     int res = 0;     for (int i = 0; i < (21); ++i)       if (tmp[i]) res |= (1 << i);     return res;   }   inline int get_nx(int st1, int st2) { return st1 ^ st2; }   void solve() {     dp[0] = 1;     for (int i = 2; i < (71); ++i) {       if (!w[i]) continue;       int st = gao(i);       for (int pre = 0; pre < (1 << 19); ++pre) {         int nx_st = get_nx(st, pre);         dp2[nx_st] += dp[pre] * f[w[i] - 1] % mod;         dp2[pre] += dp[pre] * f[w[i] - 1] % mod;         dp2[nx_st] %= mod;         dp2[pre] %= mod;       }       for (int k = 0; k < (1 << 19); ++k) dp[k] = dp2[k], dp2[k] = 0;     }     long long ans = dp[0] - 1;     if (w[1]) ans = (f[w[1]]) * ans % mod + f[w[1]] - 1;     cout << ans % mod << endl;   }   int main() {     prework();     init();     solve();   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1000000007;   ;   const int maxn = 410;   unsigned long long powmod(unsigned long long n, unsigned long long k) {     unsigned long long ret = 1;     while (k) {       if (k & 1) ret = ret * n % mod;       n = n * n % mod;       k >>= 1;     }     return ret;   }   int nxt[maxn][26];   int dp[maxn][maxn];   void upd(int& n, int k) {     if (n < 0 || n > k) n = k;   }   bool gao(const string& s, const string& t1, const string& t2) {     memset(dp, -1, sizeof(dp));     for (int i = 0; i <= t1.size(); i++)       for (int j = 0; j <= t2.size(); j++)         if (dp[i][j] >= 0 || i + j == 0) {           int p = dp[i][j] + 1;           if (i < t1.size()) {             int n = nxt[p][t1[i] -  a ];             if (n >= 0) upd(dp[i + 1][j], n);           }           if (j < t2.size()) {             int n = nxt[p][t2[j] -  a ];             if (n >= 0) upd(dp[i][j + 1], n);           }         }     return dp[t1.size()][t2.size()] >= 0;   }   char str[maxn];   char tt[maxn];   int main() {     int t;     cin >> t;     while (t--) {       cin >> str >> tt;       memset(nxt, -1, sizeof(nxt));       for (int i = strlen(str) - 1; i >= 0; i--) {         memcpy(nxt[i], nxt[i + 1], sizeof(nxt[i]));         nxt[i][str[i] -  a ] = i;       }       bool yes = false;       if (strlen(tt) == 1)         yes = (nxt[0][tt[0] -  a ] >= 0);       else {         for (int i = 0; tt[i + 1]; i++) {           char tmp = tt[i + 1];           tt[i + 1] = 0;           string t1 = tt;           tt[i + 1] = tmp;           string t2 = tt + i + 1;           if (gao(str, t1, t2)) {             yes = true;             break;           }         }       }       if (yes)         puts( YES );       else         puts( NO );     }   }
#include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   long long Query(long long L, long long R) {     cout << L <<     << R << endl;     fflush(stdout);     string s;     cin >> s;     if (L == R && s ==  Yes ) exit(0);     return s ==  Yes ;   }   int32_t main() {     long long n, k;     cin >> n >> k;     long long L = 1, R = n;     while (true) {       if (R - L + 1 <= 4 * k + 7) {         long long M = L + rng() % (R - L + 1);         if (Query(M, M)) {           return 0;         } else {           L = max(1LL, L - k);           R = min(n, R + k);         }       } else {         long long M = L + ((R - L) >> 1);         if (Query(L, M)) {           L = max(1LL, L - k);           R = min(n, M + k);         } else {           L = max(1LL, M - k);           R = min(n, R + k);         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   const long long MOD = (1e9 + 7);   const long long INF = (1e9 + 123456789);   const long long INFL = (INF * INF);   inline long long addm(long long a, long long b, long long m = MOD) {     return ((a + b) % m);   }   inline long long subm(long long a, long long b, long long m = MOD) {     return (((a - b) % m + m) % m);   }   inline long long mulm(long long a, long long b, long long m = MOD) {     return ((a * b) % m);   }   long long powm(long long a, long long b, long long m = MOD) {     long long ret = (!b) ? 1 : powm(a, b / 2, m);     return (!b) ? 1 : mulm(mulm(ret, ret, m), b % 2 ? a : 1, m);   }   long long gcd(long long a, long long b) { return (!b) ? a : gcd(b, a % b); }   long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }   long long inv(long long x, long long m = MOD) { return powm(x, m - 2, m); }   const int N = 1000500;   int a[N], lft[N], nxt[N];   vector<int> nodes, g[N];   struct SegmentTree {     int f, t;     SegmentTree *lc, *rc;     bool has_child, has_lazy = false;     int upd = 0;     int vmax = 0;     SegmentTree(int l, int r) {       if (l == r) {         f = t = l;         lc = rc = NULL;         has_child = false;       } else {         f = l;         t = r;         int mid = (l + r) / 2;         lc = new SegmentTree(l, mid);         rc = new SegmentTree(mid + 1, r);         has_child = true;       }     }     void change(int v) {       vmax += v;       upd += v;       has_lazy = true;     }     void push() {       if (!has_lazy) return;       lc->change(upd);       rc->change(upd);       upd = 0;       has_lazy = false;     }     void update(int l, int r, int x) {       if (r < f || l > t) return;       if (l <= f && t <= r) {         change(x);         return;       }       push();       lc->update(l, r, x);       rc->update(l, r, x);       vmax = max(lc->vmax, rc->vmax);     }     int query(int l, int r) {       if (r < f || l > t) return 0;       if (l <= f && t <= r) return vmax;       return vmax = max(lc->query(l, r), rc->query(l, r));     }   };   void solve() {     int n, k;     cin >> n >> k;     for (int i = 0; i < n; i++) cin >> a[i];     stack<int> st;     for (int i = n - 1; i >= 0; i--) {       while (!st.empty() && a[st.top()] <= a[i]) st.pop();       if (!st.empty())         nxt[i] = st.top();       else         nxt[i] = n;       st.push(i);     }     for (int i = 0; i < n; i++) g[nxt[i]].push_back(i);     function<void(int)> post = [&](int v) {       int l = (int)(nodes).size();       for (int u : g[v]) post(u);       lft[(int)(nodes).size()] = l;       nodes.push_back(v);     };     post(n);     SegmentTree root(0, n);     for (int i = 0; i < k; i++) root.update(lft[i], i, 1);     vector<int> ans;     ans.push_back(root.query(0, n));     for (int i = k; i < n; i++) {       root.update(lft[i - k], i - k, -1);       root.update(lft[i], i, 1);       ans.push_back(root.query(0, n));     }     for (int i = 0; i < (int)(ans).size(); i++) {       if (i) cout <<    ;       cout << ans[i];     }     cout <<   n ;   }   int main(int argc, char *argv[]) {     cin.sync_with_stdio(0);     cin.tie(NULL);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 2e5 + 100;   long long a[N];   pair<long long, long long> ask(long long l, long long r) {     cout <<  ?   << l <<     << r << endl;     long long first;     cin >> first;     if (first == -1) exit(0);     long long f;     cin >> f;     return {first, f};   }   void solve(long long l, long long r) {     if (l > r) return;     long long first, f;     tie(first, f) = ask(l, r);     long long l1 = r + 1 - f, r1 = l - 1 + f;     if (l1 <= r1) {       for (long long i = l1; i <= r1; i++) a[i] = first;       solve(l, l1 - 1);       solve(r1 + 1, r);     } else {       long long m = (l + r) / 2;       solve(l, m);       solve(m + 1, r);     }   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long n;     cin >> n;     solve(1, n);     cout <<  !  ;     for (long long i = 1; i <= n; i++) cout << a[i] <<    ;     cout << endl;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast,unroll-loops,fast-math )   using namespace std;   const int MAXN = 102, K = 900;   int n, m, k, u, v, x, y, t, a, b;   int A[MAXN];   short F1[MAXN][MAXN][2 * MAXN];   short F2[MAXN][MAXN][2 * MAXN];   short F3[MAXN][MAXN][2 * MAXN];   double dp[2][MAXN][MAXN];   int C(int x) { return x * (x + 1) / 2; }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> k;     k = min(k, K);     for (int i = 0; i < n; i++) cin >> A[i];     for (int l = 0; l < n; l++)       for (int r = l; r < n; r++) {         for (int i = 0; i < n; i++)           for (int j = i + 1; j < n; j++) {             bool ii = (l <= i && i <= r);             bool jj = (l <= j && j <= r);             if (ii && !jj) F1[i][j][l + r]++;             if (!ii && jj) F2[i][j][l + r]++;             if (ii && jj) F3[i][j][l + r]++;           }       }     int prev = 0, curr = 1;     for (int i = 0; i < n; i++)       for (int j = 0; j < i; j++) dp[0][i][j] = 1;     for (int x = 1; x <= k; x++) {       for (int i = 0; i < n; i++)         for (int j = i + 1; j < n; j++) {           dp[curr][i][j] = (C(i) + C(j - i - 1) + C(n - j - 1)) * dp[prev][i][j];           for (int cent = i; cent < n + i; cent++)             dp[curr][i][j] += F1[i][j][cent] * dp[prev][cent - i][j];           for (int cent = j; cent < n + j; cent++)             dp[curr][i][j] += F2[i][j][cent] * dp[prev][i][cent - j];           for (int cent = j; cent < n + i; cent++)             dp[curr][i][j] += F3[i][j][cent] * dp[prev][cent - i][cent - j];           dp[curr][i][j] /= C(n);           dp[curr][j][i] = 1. - dp[curr][i][j];         }       swap(prev, curr);     }     double ans = 0;     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++)         if (A[i] < A[j]) ans += dp[prev][i][j];     cout << setprecision(12) << fixed << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int tab[n];     long long s = 0;     for (int i = 0; i < n; i++) {       cin >> tab[i];       if (i == tab[i]) {         s++;         tab[i] = -1;       }     }     bool bo = false;     for (int i = 0; i < n; i++) {       if (tab[i] != -1) {         if (tab[tab[i]] == i) {           s += 2;           bo = false;           break;         }         bo = true;       }     }     if (bo) s++;     cout << s;   }
#include <bits/stdc++.h>   #pragma GCC optimize( O2 )   using namespace std;   string conv(int n) {     string kq =   ;     while (n != 0) {       int r = n % 26;       if (r == 0) r = 26;       kq = char(r - 1 +  A ) + kq;       n = (n - r) / 26;     }     return kq;   }   int conv(string s) {     int kq = 0;     int n = s.size();     int tmp = 1;     for (int i = n - 1; i >= 0; i--) {       int k = int(s[i] -  A ) + 1;       kq += tmp * k;       tmp *= 26;     }     return kq;   }   int type(string s) {     if (s[0] !=  R ) return 1;     if (s[1] >=  A  && s[1] <=  Z ) return 1;     bool kt = false;     int n = s.size();     for (int i = 0; i <= n - 1; i++)       if (s[i] ==  C ) {         kt = true;         break;       }     if (!kt) return 1;     return 2;   }   void chuyen(string s) {     if (type(s) == 1) {       int n = s.size();       string x1 =   ;       int j = 0;       while (s[j] >=  A  && s[j] <=  Z ) {         x1 += s[j];         j++;       }       cout <<  R ;       for (int i = j; i <= n - 1; i++) cout << s[i];       cout <<  C  << conv(x1) <<   n ;     }     if (type(s) == 2) {       int kq = 0;       int tmp = 1;       int j = s.size() - 1;       while (s[j] >=  0  && s[j] <=  9 ) {         kq += (s[j] -  0 ) * tmp;         tmp *= 10;         j--;       }       cout << conv(kq);       for (int i = 1; i <= j - 1; i++) cout << s[i];       cout <<   n ;     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     while (n--) {       string s;       cin >> s;       chuyen(s);     }   }
#include <bits/stdc++.h>   using namespace std;   void solution() {     long long n;     cin >> n;     vector<vector<long long>> v(n, vector<long long>(n, 0));     if (n % 2 != 0) {       v[n - 1][(n - 1) / 2] = 1;       v[(n - 1) / 2][n - 1] = 1;     }     for (long long i = 0; i < n; i++) {       for (long long j = 0; j < n; j++) {         if (i == j || i == n - j - 1) v[i][j] = 1;         cout << v[i][j] <<    ;       }       cout <<   n ;     }   }   int32_t main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     long long t;     cin >> t;     while (t--) solution();   }