#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> bob(n + 1), alice(n + 1, -1);
    vector<int> freq(n + 2, 0);
    for (int i = 1; i <= n; i++) {
      cin >> bob[i];
      freq[bob[i]]++;
    }
    if (x == n) {
      cout << "YES\n";
      for (int i = 1; i <= n; i++) cout << bob[i] << " ";
      cout << '\n';
      continue;
    }
    int notPresent;
    vector<pair<int, int> > st;
    for (int i = 1; i <= n + 1; i++) {
      if (freq[i] == 0) {
        notPresent = i;
      } else {
        st.push_back(make_pair(freq[i], i));
      }
    }
    sort(st.begin(), st.end(), greater<pair<int, int> >());
    int rem = n;
    int cap = 0;
    vector<pair<int, int> > final;
    for (int i = st.size() - 1; i >= 0; i--) {
      if (rem - st[i].first * (i + 1) > x) {
        rem = rem - st[i].first;
        final.push_back(st[i]);
        cap = st[i].first;
      } else {
        if ((rem - x) % (i + 1) == 0) {
          int tt = (rem - x) / (i + 1);
          for (int j = i; j >= 0; j--) {
            final.push_back(make_pair(tt, st[j].second));
          }
        } else {
          int tt = (rem - x) / (i + 1);
          int extra = (rem - x) % (i + 1);
          int counter = 1;
          for (int j = 0; j <= i; j++) {
            if (counter <= extra) {
              final.push_back(make_pair(tt + 1, st[j].second));
              counter++;
            } else {
              final.push_back(make_pair(tt, st[j].second));
            }
          }
        }
        break;
      }
    }
    sort(final.begin(), final.end(), greater<pair<int, int> >());
    int flag = 0;
    vector<int> color[n + 2];
    vector<pair<int, int> > tst;
    for (int i = 1; i <= n; i++) {
      color[bob[i]].push_back(i);
    }
    set<int> storeInd;
    storeInd.clear();
    for (int i = 0; i < final.size(); i++) {
      for (int j = 0; j < final[i].first; j++) {
        tst.push_back(make_pair(final[i].second, color[final[i].second][j]));
        storeInd.insert(color[final[i].second][j]);
      }
    }
    int sz = tst.size();
    for (int i = 0; i < y - x; i++) {
      if (tst[sz - 1 - i].first ==
          tst[(-final[0].first + 2 * sz - 1 - i) % sz].first) {
        flag = 1;
        break;
      }
      alice[tst[(-final[0].first + 2 * sz - 1 - i) % sz].second] =
          tst[sz - 1 - i].first;
      storeInd.erase(tst[(-final[0].first + 2 * sz - 1 - i) % sz].second);
    }
    for (int i = 1; i <= n; i++) {
      if (storeInd.find(i) != storeInd.end()) {
        alice[i] = notPresent;
      } else if (alice[i] == -1) {
        alice[i] = bob[i];
      }
    }
    if (flag == 1) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      for (int i = 1; i <= n; i++) cout << alice[i] << " ";
      cout << '\n';
    }
  }
}
