#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e5 + 10;
int q;
int n, x, y;
int ar[N], ans[N];
int cnt[N];
vector<int> pos[N];
void solve() {
  cin >> n >> x >> y;
  fill(cnt, cnt + n + 3, 0);
  fill(ans, ans + n + 3, 0);
  for (int i = 1; i <= n + 1; i++) {
    pos[i].clear();
  }
  int none = -1;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
    cnt[ar[i]]++;
    pos[ar[i]].push_back(i);
  }
  set<pii> setdah;
  for (int i = 1; i <= n + 1; i++) {
    if (cnt[i] == 0) none = i;
    setdah.insert(make_pair(cnt[i], i));
  }
  int slot = n;
  while (x) {
    auto temp = *setdah.rbegin();
    setdah.erase(temp);
    cnt[temp.second]--;
    x--;
    y--;
    slot--;
    ans[pos[temp.second].back()] = temp.second;
    pos[temp.second].pop_back();
    setdah.insert(make_pair(cnt[temp.second], temp.second));
  }
  bool ok = 1;
  vector<int> ambil;
  vector<pii> vsisa;
  for (int i = 1; i <= n + 1; i++) {
    if (cnt[i]) vsisa.push_back(make_pair(cnt[i], i));
  }
  sort(vsisa.begin(), vsisa.end());
  int len = vsisa.size();
  int sisaambil = len;
  int alt = -1, mnalt = N;
  int lastid;
  for (int i = 0; i < len && y; i++) {
    int avg = (sisaambil + y - 1) / sisaambil;
    int cur = min(avg, vsisa[i].first);
    sisaambil--;
    y -= cur;
    for (int j = 0; j < cur; j++) {
      ambil.push_back(vsisa[i].second);
    }
    vsisa[i].first -= cur;
    lastid = i;
  }
  int butuh = ambil.size();
  deque<pii> slots;
  for (auto x : ambil) {
    slots.push_back(make_pair(pos[x].back(), x));
    pos[x].pop_back();
  }
  for (int i = len - 1; i >= 0; i--) {
    if (vsisa[i].first) {
      alt = vsisa[i].second;
      break;
    }
  }
  int extra = -1;
  if (alt != -1) {
    extra = pos[alt].back();
  }
  while (butuh) {
    int cur = ambil.back();
    if (slots.front().second != cur) {
      ans[slots.front().first] = cur;
      slots.pop_front();
    } else if (slots.back().second != cur) {
      ans[slots.back().first] = cur;
      slots.pop_back();
    } else {
      if (extra != -1 && cur != alt) {
        ans[extra] = cur;
        extra = -1;
      } else {
        cout << "NO" << '\n';
        return;
      }
    }
    ambil.pop_back();
    butuh--;
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] == 0) {
      ans[i] = none;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> q;
  while (q--) {
    solve();
  }
  return 0;
}
