malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   int k, n, m, x, ans;   int a[N];   string second, r;   map<string, int> vis1, vis2;   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       char e[50];       scanf( %s , e);       r = second = e;       while (second.find( kh ) != -1) {         x = second.find( kh );         second.erase(second.begin() + x);       }       r = second;       while (second.find( oo ) != -1) {         x = second.find( oo );         second[x] =  u ;         second.erase(second.begin() + x + 1);       }       while (r.find( u ) != -1) {         x = r.find( u );         r[x] =  o ;         r.insert(r.begin() + x,  o );       }       vis1[second] = 1;       vis2[r] = 1;     }     printf( %d n , min(vis1.size(), vis2.size()));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   #pragma GCC optimize  trapv    void solve() {     int64_t n, x, y;     cin >> n >> x >> y;     vector<pair<int64_t, int64_t> > a;     for (uint64_t i = 0; i < n; i++) {       int u, v;       cin >> u >> v;       a.push_back(make_pair(u, v));     }     sort(a.begin(), a.end());     multiset<int64_t, greater<int64_t> > curr;     int64_t res = 0;     for (uint64_t i = 0; i < a.size(); i++) {       auto it = curr.upper_bound(a[i].first);       if (it != curr.end()) {         if (((a[i].second - *it) * y) < (x + y * (a[i].second - a[i].first))) {           res += (a[i].second - *it) * y;           res %= 1000000007;           curr.erase(it);         } else {           res += x + y * (a[i].second - a[i].first);           res %= 1000000007;         }         curr.insert(a[i].second);       } else {         res += x + y * (a[i].second - a[i].first);         res %= 1000000007;         curr.insert(a[i].second);       }     }     cout << res << endl;     return;   }   int main() {     std::ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x1, y1, x2, y2;     cin >> x1 >> y1 >> x2 >> y2;     int a = abs(x1 - x2);     int b = abs(y1 - y2);     int u = min(a, b);     cout << u + abs(a - b);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int arr[n][n];     for (int i = 0; i < n; i++) {       string s;       cin >> s;       for (int j = 0; j < n; j++) {         arr[j][i] = s[j];       }     }     int cnt = 0;     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         int c = 0;         if (i != 0) {           if (arr[j][i - 1] ==  o ) {             c++;           }         }         if (i != n - 1) {           if (arr[j][i + 1] ==  o ) {             c++;           }         }         if (j != 0) {           if (arr[j - 1][i] ==  o ) {             c++;           }         }         if (j != n - 1) {           if (arr[j + 1][i] ==  o ) {             c++;           }         }         if (c % 2 == 0) {           cnt++;         }       }     }     if (cnt == n * n) {       cout <<  YES ;     } else {       cout <<  NO ;     }     return 0;   }
#include <bits/stdc++.h>   const long long M = 1e9 + 7;   const double pi = 3.14159265358979323846;   using namespace std;   long long ans = 1;   vector<long long> adj[2005];   long long vis[200005] = {0};   void dfs(long long x) {     vis[x] = 1;     for (long long i = 0; i < adj[x].size(); i++) {       if (vis[adj[x][i]] == 0) dfs(adj[x][i]);     }   }   bool prime(long long n) {     if (n <= 2)       return false;     else {       for (long long i = 2; i <= sqrt(n); i++) {         if (n % i == 0) {           return false;         }       }       return true;     }   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long t = 1;     while (t--) {       long long n;       cin >> n;       for (long long i = 0; i < n; i++) {         if (i % 2 == 0) {           for (long long j = 0; j < n; j++) {             if (j % 2 == 0)               cout <<  W ;             else               cout <<  B ;           }           cout <<   n ;         } else {           for (long long j = 0; j < n; j++) {             if (j % 2 == 0)               cout <<  B ;             else               cout <<  W ;           }           cout <<   n ;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, cnt0 = 3;   int g, r, b;   bool markb = true, markg = true, markr = true;   char id[ Z ][ Z ];   vector<char> st, m;   int tt[500];   int main() {     scanf( %d n , &n);     for (int i = 1; i <= n; ++i) {       char ch;       scanf( %c , &ch);       if (ch ==  B ) {         ++b;         cnt0 -= markb;         markb = false;       }       if (ch ==  G ) {         ++g;         cnt0 -= markg;         markg = false;       }       if (ch ==  R ) {         ++r;         cnt0 -= markr;         markr = false;       }     }     if (b >= 1 && g >= 1 && r >= 1) {       printf( BGR );       return 0;     }     if (cnt0 == 2) {       if (b) {         printf( B );         return 0;       }       if (g) {         printf( G );         return 0;       }       if (r) {         printf( R );         return 0;       }     }     if (g == 0) {       if (r >= 2 && b >= 2) {         printf( BGR );         return 0;       }     }     if (r == 0) {       if (g >= 2 && b >= 2) {         printf( BGR );         return 0;       }     }     if (b == 0) {       if (g >= 2 && r >= 2) {         printf( BGR );         return 0;       }     }     markb = markg = markr = false;     id[ G ][ G ] =  G ;     id[ R ][ R ] =  R ;     id[ B ][ B ] =  B ;     id[ G ][ R ] = id[ R ][ G ] =  B ;     id[ B ][ R ] = id[ R ][ B ] =  G ;     id[ G ][ B ] = id[ B ][ G ] =  R ;     if (b >= 1) m.push_back( B );     if (b >= 2) m.push_back( B );     if (g >= 1) m.push_back( G );     if (g >= 2) m.push_back( G );     if (r >= 1) m.push_back( R );     if (r >= 2) m.push_back( R );     for (int i = 1; i <= m.size(); ++i) tt[i] = i;     do {       st.clear();       for (int i = 1; i <= m.size(); ++i) st.push_back(m[tt[i] - 1]);       for (int i = 0; i < st.size() - 1;) {         st.push_back(id[st[i]][st[i + 1]]);         i += 2;       }       if (st.back() ==  B ) markb = true;       if (st.back() ==  G ) markg = true;       if (st.back() ==  R ) markr = true;     } while (next_permutation(tt + 1, tt + m.size() + 1));     if (markb) printf( B );     if (markg) printf( G );     if (markr) printf( R );     return 0;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     long int x, y;     cin >> n >> m >> x >> y;     long int* a = new long int[n];     long int* b = new long int[m];     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < m; i++) cin >> b[i];     int count = -1, indi = 0, indj = 0;     long int** res = new long int*[min(m, n)];     while ((indi < n) && (indj < m))       if (b[indj] < a[indi] - x)         ++indj;       else if (b[indj] > a[indi] + y)         ++indi;       else {         res[(++count)] = new long int[2];         res[count][0] = indi + 1;         res[count][1] = indj + 1;         ++indi;         ++indj;       }     cout << count + 1 << endl;     for (int i = 0; i < count + 1; i++)       cout << res[i][0] <<     << res[i][1] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double dp[1100][1100];   int n, m, x, y;   int main() {     int i, j, T;     scanf( %d%d%d%d , &n, &m, &x, &y);     if (m == 1) {       printf( %d n , (n - x) * 2);       return 0;     }     for (i = n - 1; i >= x; --i)       for (T = 1; T <= 60; ++T)         for (j = 1; j <= m; ++j) {           if (j == 1)             dp[i][j] = 1 + (dp[i + 1][j] + dp[i][j] + dp[i][j + 1]) / 3;           else if (j == m)             dp[i][j] = 1 + (dp[i + 1][j] + dp[i][j] + dp[i][j - 1]) / 3;           else             dp[i][j] =                 1 + (dp[i][j] + dp[i + 1][j] + dp[i][j - 1] + dp[i][j + 1]) / 4;         }     printf( %.9lf n , dp[x][y]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, in = 2;   long long suma, bit[1000000];   double x, y, w, ab[100003];   pair<double, double> ar[100004];   map<double, int> busca;   void updt(int p) {     for (int i = p; i <= n; i += (i & -i)) bit[i]++;   }   int query(int p) {     int s = 0;     for (int i = p; i > 0; i -= (i & -i)) s += bit[i];     return s;   }   bool op(pair<double, double> f, pair<double, double> g) {     if (f.first != g.first) return f.first < g.first;     return f.second > g.second;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n >> w;     for (int i = 0; i < n; i++) {       cin >> x >> y;       ar[i] = make_pair(-(x / (y - w)), -(x / (y + w)));       ab[i] = ar[i].second;     }     sort(ar, ar + n, op);     sort(ab, ab + n);     busca[ab[0]] = 1;     for (int i = 1; i < n; i++)       if (ab[i] != ab[i - 1]) busca[ab[i]] = in++;     for (int i = 0; i < n; i++) {       in = busca[ar[i].second];       suma += query(n - in + 1);       updt(n - in + 1);     }     cout << suma;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 305;   vector<pair<int, int> > e;   vector<int> b;   int a[MAXN];   bool mark[MAXN], x[MAXN][MAXN];   int n, k, m, cnt;   void add(int u, int v) {     if (x[u][v]) return;     cnt++;     e.push_back(pair<int, int>(u, v));     x[u][v] = x[v][u] = true;   }   void ghi() {     for (int i = 0; i < m; i++) printf( %d %d n , e[i].first, e[i].second);   }   int main() {     if (0) {       freopen( input.txt ,  r , stdin);       freopen( output.txt ,  w , stdout);     };     scanf( %d%d%d , &n, &m, &k);     for (int i = 1; i <= k; i++) scanf( %d , &a[i]), mark[a[i]] = true;     int nn = n - k;     if (k == n) {       puts( -1 );       return 0;     }     for (int i = 1; i <= n; i++)       if (!mark[i]) b.push_back(i);     add(a[1], b[0]);     if (cnt == m) {       ghi();       return 0;     }     for (int i = 0; i < nn - 1; i++) {       add(b[i], b[i + 1]);       if (cnt == m) {         ghi();         return 0;       }     }     add(b[nn - 1], a[2]);     for (int i = 2; i < k; i++) {       add(a[i], a[i + 1]);       if (cnt == m) {         ghi();         return 0;       }     }     for (int i = 0; i < nn - 1; i++)       for (int j = i + 1; j < nn; j++) {         add(b[i], b[j]);         if (cnt == m) {           ghi();           return 0;         }       }     for (int i = 2; i < k; i++)       for (int j = i + 1; j <= k; j++) {         add(a[i], a[j]);         if (cnt == m) {           ghi();           return 0;         }       }     for (int i = 0; i < nn; i++)       for (int j = 2; j <= k; j++) {         add(b[i], a[j]);         if (cnt == m) {           ghi();           return 0;         }       }     for (int i = 1; i < nn; i++) {       add(a[1], b[i]);       if (cnt == m) {         ghi();         return 0;       }     }     puts( -1 );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int COUNT = 600;   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int N;     cin >> N;     string S;     cin >> S;     vector<int> on_count(COUNT, 0);     for (int i = 0; i < N; i++) {       int a, b;       cin >> a >> b;       int goal = b;       int status = S[i] -  0 ;       for (int t = 0; t < COUNT; t++) {         if (t == goal) {           status = 1 - status;           goal += a;         }         on_count[t] += status;       }     }     cout << *max_element(on_count.begin(), on_count.end()) <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   double weight;   struct edge {     int u, v, used, id, w, flag;     bool operator<(const edge &b) const {       return w + weight * flag < b.w + weight * b.flag;     }   } e[200001];   const double eps = 1e-10;   int n, m, k, p[10001];   int find(int x) { return p[x] == x ? x : p[x] = find(p[x]); }   int count(double x, int final = 0) {     weight = x;     for (int i = 0; i < m; i++) e[i].used = 0;     for (int i = 1; i <= n; i++) p[i] = i;     sort(e, e + m);     int ans = 0;     for (int i = 0; i < m; i++) {       int x = find(e[i].u), y = find(e[i].v);       if (x != y && !(final && ans == k && e[i].flag)) {         p[x] = y;         e[i].used = 1;         if (e[i].flag) ans++;       }     }     return ans;   }   int main() {     scanf( %d%d%d , &n, &m, &k);     for (int i = 0; i < m; i++)       scanf( %d%d%d , &e[i].u, &e[i].v, &e[i].w),           e[i].id = i + 1, e[i].flag = (e[i].u == 1 || e[i].v == 1);     double l = -1e5, r = 1e5 + .3;     while (l + eps < r) {       double m = (l + r) / 2;       int res = count(m);       if (res < k)         r = m;       else         l = m;       if (res == k) break;     }     count(l, 1);     int cnt = 0, cntk = 0;     for (int i = 0; i < m; i++) cnt += e[i].used, cntk += e[i].used * e[i].flag;     if (cnt != n - 1 || cntk != k) {       puts( -1 );       return 0;     }     printf( %d n , n - 1);     for (int i = 0; i < m; i++)       if (e[i].used) printf( %d  , e[i].id);     puts(  );   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline bool fs(T &x) {     int c = getchar();     int sgn = 1;     while (~c && c <  0  || c >  9 ) {       if (c ==  - ) sgn = -1;       c = getchar();     }     for (x = 0; ~c &&  0  <= c && c <=  9 ; c = getchar()) x = x * 10 + c -  0 ;     x *= sgn;     return ~c;   }   int main() {     long long int n;     fs(n);     if (n % 4 == 0)       cout <<  4  << endl;     else       cout <<  0  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int win(char a, char b) {     if (a ==  8 ) {       if (b ==  8 ) return 0;       return (b ==  [  ? 1 : -1);     }     if (a ==  [ ) {       if (b ==  [ ) return 0;       return (b ==  (  ? 1 : -1);     }     if (a ==  ( ) {       if (b ==  ( ) return 0;       return (b ==  8  ? 1 : -1);     }   }   int main() {     string s1, s2;     getline(cin, s1);     getline(cin, s2);     int t = s1.length();     --t;     int wn = 0;     for (int i = 0; i < t; i += 2) {       wn += win(s1[i], s2[i]);     }     if (wn > 0)       cout <<  TEAM 1 WINS n ;     else if (wn < 0)       cout <<  TEAM 2 WINS n ;     else       cout <<  TIE n ;   }
#include <bits/stdc++.h>   using namespace std;   int n, k, G, T;   string s;   string solve() {     for (int i = 0; i < s.size(); i++)       if (s[i] ==  G ) G = i;     for (int i = 0; i < s.size(); i++)       if (s[i] ==  T ) T = i;     if (G > T) swap(G, T);     int i = 0;     for (i = G; i < T; i += k) {       if (s[i] ==  # ) return  NO ;     }     return i == T ?  YES  :  NO ;   }   int main() {     cin >> n >> k;     cin >> s;     cout << solve() << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int n, a, b;     cin >> n >> a >> b;     vector<int> c(n);     for (int i = 0; i < n; ++i) {       cin >> c[i];     }     int i = 0, j = n - 1;     int ans = 0;     while (i < j) {       if (c[i] == c[j] && c[i] != 2) {         ++i;         --j;       } else if (c[i] != c[j] && c[i] != 2 && c[j] != 2) {         cout << -1;         return 0;       } else if (c[i] == 2 && c[j] != 2) {         if (c[j] == 0)           ans += a;         else if (c[j] == 1)           ans += b;         ++i;         --j;       } else if (c[j] == 2 && c[i] != 2) {         if (c[i] == 0)           ans += a;         else if (c[i] == 1)           ans += b;         ++i;         --j;       } else if (c[i] == c[j] && c[i] == 2) {         ans += 2 * min(a, b);         ++i;         --j;       }     }     if (n % 2 && c[i] == 2) {       ans += min(a, b);     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   string smallest(string str) {     int n = str.length();     if (n & 1) return str;     int mid = n / 2;     string s = smallest(str.substr(0, n / 2));     string t = smallest(str.substr(n / 2, n / 2));     if (s > t) swap(s, t);     str = s + t;     return str;   }   int main() {     string s1, s2;     cin >> s1 >> s2;     puts(smallest(s1) == smallest(s2) ?  YES  :  NO );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 300100;   priority_queue<pair<long long, int>, vector<pair<long long, int> >,                  greater<pair<long long, int> > >       vec[N];   vector<int> g[N];   long long tag[N];   int fa[N], fat[N], sz[N];   int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }   void dfs(int x) {     for (int i : g[x])       if (i != fat[x]) {         fat[i] = x;         sz[x]++;         dfs(i);       }   }   int n, m;   void U(int x, int y) {     fa[y] = x;     if (vec[x].size() < vec[y].size()) {       swap(vec[x], vec[y]);       swap(tag[x], tag[y]);     }     --sz[x];     sz[x] += sz[y];     while (!vec[y].empty()) {       auto i = vec[y].top();       vec[y].pop();       i.first += tag[y] - tag[x];       vec[x].push(i);     }   }   int q[N], cnt;   long long ans;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     for (int i = 1; i <= n; i++) fa[i] = i;     for (int i = 1; i < n; ++i) {       int x, y;       cin >> x >> y;       g[x].push_back(y);       g[y].push_back(x);     }     dfs(1);     for (int i = 1; i <= m; i++) {       int x, y, z;       cin >> x >> y >> z;       if (x == y) continue;       vec[x].emplace(z, y);     }     for (int i = 2; i <= n; i++)       if (!sz[i]) q[++cnt] = i;     for (; cnt;) {       int u = find(q[cnt--]);       if (vec[u].empty()) {         cout << -1 << endl;         return 0;       }       int v = vec[u].top().second, w = vec[u].top().first + tag[u];       ans += w;       assert(w >= 0);       tag[u] = -vec[u].top().first;       vec[u].pop();       v = find(v);       while (u != v) {         int t = find(fat[u]);         U(t, u);         u = find(u);       }       if (u != 1 && !sz[u]) q[++cnt] = u;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[4] = {-1, 1, 0, 0};   int dy[4] = {0, 0, -1, 1};   int sx, sy;   char m[1005][1005];   int vis[1005][1005][4];   int flag;   int n, k;   void bfs(int x, int y, int l, int c) {     if (x < 0 || x >= n || y < 0 || y >= k) return;     if (m[x][y] ==  * ) return;     if (vis[x][y][l] <= c) return;     if (c > 2) return;     vis[x][y][l] = c;     if (m[x][y] ==  T ) {       flag = 1;       return;     }     for (int i = 0; i < 4; i++) {       int xx = x + dx[i];       int yy = y + dy[i];       if (l == i)         bfs(xx, yy, l, c);       else         bfs(xx, yy, i, c + 1);     }     return;   }   int main() {     scanf( %d%d , &n, &k);     for (int i = 0; i < n; i++) {       scanf( %s , m[i]);       for (int j = 0; j < k; j++) {         if (m[i][j] ==  S ) {           sx = i;           sy = j;         }       }     }     flag = 0;     memset(vis, 0x3f3f3f, sizeof(vis));     for (int i = 0; i < 4; i++) {       int xx, yy;       xx = sx + dx[i];       yy = sy + dy[i];       bfs(xx, yy, i, 0);     }     if (flag)       printf( YES n );     else       printf( NO n );   }
#include <bits/stdc++.h>   using namespace std;   const int L = 1000 + 10;   int b[L];   int w, m, l = 0;   int main() {     cin >> w >> m;     if (w > 3)       while (m) {         int q = m % w;         m /= w;         if (q > 1 && q < w - 1) {           cout <<  NO  << endl;           return 0;         }         if (q == w - 1) m++;       }     cout <<  YES  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[505][505];   int b[505][505];   priority_queue<int> aq[1005];   priority_queue<int> bq[1005];   int main() {     int n, m;     scanf( %d%d , &n, &m);     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) {         scanf( %d , &a[i][j]);         aq[i + j].push(a[i][j]);       }     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++) {         scanf( %d , &b[i][j]);         bq[i + j].push(b[i][j]);       }     for (int i = 0; i <= n + m; i++) {       while (!aq[i].empty() && !bq[i].empty()) {         int nowa = aq[i].top();         int nowb = bq[i].top();         if (nowa != nowb) {           printf( NO n );           return 0;         }         aq[i].pop();         bq[i].pop();       }     }     printf( YES n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline double f(int n) { return n * (n + 1) / 2; }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int n, k;     cin >> n >> k;     double P = 1. / f(n);     vector<int> V(n);     for (auto& x : V) cin >> x;     vector<vector<vector<double>>> DP(         k + 1, vector<vector<double>>(n, vector<double>(n, 0)));     for (int i = 0; i < n; i++)       for (int j = i; j < n; j++)         for (int k = i; k <= j; k++)           for (int l = k + 1; l <= j; l++) DP[0][i][j] += V[k] > V[l];     for (int s = 1; s <= k; s++)       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++)               DP[s][i][j] +=                   (j < l || i > r                        ? DP[s - 1][i][j]                        : (i <= l && r <= j                               ? DP[s - 1][i][j] + f(r - l) - DP[s - 1][l][r] * 2                               : (l <= i && j <= r                                      ? f(j - i) - DP[s - 1][l + r - j][r + l - i]                                      : (i >= l ? DP[s - 1][r + 1][j] + f(r - i) -                                                      DP[s - 1][l][l + r - i] +                                                      DP[s - 1][l][j] -                                                      DP[s - 1][l + r - i + 1][j] -                                                      DP[s - 1][l][r] +                                                      DP[s - 1][l + r - i + 1][r]                                                : DP[s - 1][i][l - 1] + f(j - l) -                                                      DP[s - 1][r + l - j][r] +                                                      DP[s - 1][i][r] -                                                      DP[s - 1][i][r + l - j - 1] -                                                      DP[s - 1][l][r] +                                                      DP[s - 1][l]                                                        [r + l - j - 1])))) *                   P;     cout << setprecision(20) << DP[k][0][n - 1];     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[100005], f[100005];   int main() {     int n, i;     long long k;     map<int, int> cnt;     scanf( %d , &n);     cin >> k;     k--;     for (i = 0; i < n; ++i) scanf( %d , &a[i]), cnt[a[i]]++;     sort(a, a + n);     f[0] = 0;     for (i = 1; i < n; ++i) f[i] = a[i] == a[i - 1] ? f[i - 1] : i;     printf( %d  , i = a[k / n]);     k -= 1LL * n * f[k / n];     printf( %d n , a[k / cnt[i]]);   }