func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   int n, x, y, b[N], cnt[N], a[N];   bool vis[N];   bool cmp(int i, int j) {     return make_pair(cnt[b[i]], b[i]) > make_pair(cnt[b[j]], b[j]);   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int T;     cin >> T;     while (T--) {       cin >> n >> x >> y;       for (int i = 1; i <= n + 1; i++) cnt[i] = 0;       for (int i = 1; i <= n; i++) cin >> b[i], ++cnt[b[i]], vis[i] = 0;       int oth = 0;       for (int i = 1; i <= n + 1; i++)         if (!cnt[i]) {           oth = i;           break;         }       int l = 0, r = n;       while (l < r) {         int mid = (l + r) >> 1, sum = 0;         for (int i = 1; i <= n + 1; i++) sum += max(0, cnt[i] - mid);         if (sum <= x)           r = mid;         else           l = mid + 1;       }       if (2 * (n - x - l) < y - x) {         cout <<  NO n ;         continue;       }       cout <<  YES n ;       int sum = x;       for (int i = 1; i <= n; i++)         if (cnt[b[i]] > l) --cnt[b[i]], a[i] = b[i], vis[i] = 1, --sum;       for (int i = 1; i <= n && sum; i++)         if (!vis[i]) --cnt[b[i]], a[i] = b[i], vis[i] = 1, --sum;       vector<int> id;       for (int i = 1; i <= n; i++)         if (!vis[i]) id.push_back(i);       sort(id.begin(), id.end(), cmp);       vector<int> seq;       for (int i = 0; i < int(id.size()); i++)         if (i == 0 || b[id[i]] != b[id[i - 1]]) seq.push_back(b[id[i]]);       if (!seq.empty()) {         seq.push_back(seq[0]);         seq.erase(seq.begin());       }       for (int i = 0, p = 0; i < int(seq.size()); i++)         for (int j = 1; j <= cnt[seq[i]]; j++) a[id[p++]] = seq[i];       sum = n - x;       for (int i = 1; i <= n; i++)         if (!vis[i] && a[i] == b[i]) a[i] = oth, --sum;       for (int i = 1; i <= n && sum > y - x; i++)         if (!vis[i] && a[i] != oth) a[i] = oth, --sum;       for (int i = 1; i <= n; i++) cout << a[i] <<    ;       cout <<   n ;     }     return 0;   }   