#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e5 + 5;
vector<ll> vec[N];
ll ans[N], mpa[N], mpb[N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll tc;
  cin >> tc;
  while (tc--) {
    ll n, x, y;
    cin >> n >> x >> y;
    y -= x;
    for (int i = 0; i <= n + 1; ++i)
      vec[i].clear(), ans[i] = 0, mpa[i] = 0, mpb[i] = 0;
    ll b[n], unseen = 0;
    for (int i = 1; i <= n; ++i) cin >> b[i], vec[b[i]].push_back(i);
    priority_queue<pair<int, int>> pq;
    for (int i = 1; i <= n + 1; ++i) {
      if (vec[i].size() == 0)
        unseen = i;
      else
        pq.push({(int)vec[i].size(), i});
    }
    for (int i = 1; i <= x; i++) {
      pair<int, int> temp = pq.top();
      pq.pop();
      ans[vec[temp.second].back()] = temp.second;
      vec[temp.second].pop_back();
      if (temp.first != 1) pq.push({temp.first - 1, temp.second});
    }
    vector<pair<int, int>> uwu;
    int most = 0;
    for (int i = 1; i <= n + 1; ++i) {
      if (vec[i].size() == 0) continue;
      most = max(most, (int)vec[i].size());
      for (int j = 0; j < vec[i].size(); ++j) uwu.push_back({vec[i][j], i});
    }
    int cnt = 0;
    for (int i = 0; i < uwu.size(); ++i) {
      most %= uwu.size();
      if (cnt == y) break;
      if (uwu[i].second != uwu[most].second)
        cnt++, ans[uwu[i].first] = uwu[most++].second;
    }
    if (cnt != y) {
      cout << "NO" << '\n';
      continue;
    }
    cout << "YES" << '\n';
    for (int i = 1; i <= n; ++i) {
      if (ans[i] == 0)
        cout << unseen << " ";
      else
        cout << ans[i] << " ";
    }
    cout << '\n';
  }
}
