func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, i, j, k, chng_cnt;     cin >> n >> m;     int ara1[n + 1], ara2[n + 1], cnt[m + 1], maximizedMin;     memset(cnt, 0, sizeof(cnt));     memset(ara1, 0, sizeof(ara1));     memset(ara2, 0, sizeof(ara2));     for (i = 1; i <= n; i++) {       cin >> ara1[i];     }     maximizedMin = n / m;     for (i = 1; i <= n; i++) {       if (ara1[i] > m) {         ara2[i] = -1;       } else {         cnt[ara1[i]]++;         if (cnt[ara1[i]] <= maximizedMin) {           ara2[i] = ara1[i];         } else {           ara2[i] = -1;         }       }     }     chng_cnt = 0;     for (i = 1; i <= m; i++) {       if (cnt[i] < maximizedMin) {         for (j = 1; j <= n; j++) {           if (cnt[i] == maximizedMin) break;           if (ara2[j] == -1) {             ara2[j] = i;             cnt[i]++;             chng_cnt++;           }         }       }     }     for (i = 1; i <= n; i++) {       if (ara2[i] == -1) {         ara2[i] = ara1[i];       }     }     printf( %d %d n , maximizedMin, chng_cnt);     for (i = 1; i <= n; i++) {       if (i == n)         printf( %d n , ara2[i]);       else         printf( %d  , ara2[i]);     }     return 0;   }   