#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll t;
  cin >> t;
  for (ll i = 0; i < t; i++) {
    ll n, x, y;
    cin >> n >> x >> y;
    vector<ll> in(n);
    vector<vector<ll>> pos(n + 1);
    for (ll i = 0; i < n; i++) {
      cin >> in[i];
      in[i]--;
      pos[in[i]].push_back(i);
    }
    ll free = 0;
    while (!pos[free].empty()) free++;
    vector<ll> res(n, free);
    priority_queue<pair<ll, ll>> pq;
    for (ll i = 0; i <= n; i++) {
      pq.push({(ll)(pos[i]).size(), i});
    }
    for (ll i = 0; i < x; i++) {
      auto e = pq.top();
      pq.pop();
      res[pos[e.second].back()] = e.second;
      pos[e.second].pop_back();
      e.first--;
      pq.push(e);
    }
    ll l = 0;
    ll r = n;
    while (l + 1 < r) {
      ll m = (l + r) / 2;
      ll sum = 0;
      for (auto& v : pos) {
        sum += min(m, (ll)(v).size());
      }
      if (sum >= 2 * m) {
        l = m;
      } else {
        r = m;
      }
    }
    vector<ll> a;
    while (!pq.empty()) {
      auto e = pq.top();
      pq.pop();
      for (ll i = 0; i < (ll)(pos[e.second]).size() && i < l; i++) {
        a.push_back(pos[e.second][i]);
      }
    }
    if ((ll)(a).size() >= y - x) {
      for (ll i = 0; i < y - x; i++) {
        res[a[i]] = in[a[(i + l) % (ll)(a).size()]];
      }
      cout << "YES" << endl;
      for (ll x : res) {
        cout << x + 1 << " ";
      }
      cout << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
