#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int b[maxn], a[maxn], X[maxn], c[maxn], cnt;
vector<int> first[maxn];
priority_queue<pair<int, int> > q;
int main() {
  int T, n, second, y;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &n, &second, &y);
    int M = 0, Max = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", b + i);
      a[i] = 0;
      first[b[i]].push_back(i);
    }
    for (int i = 1; i <= n + 1; i++)
      if (first[i].empty())
        M = i;
      else
        q.push(make_pair(first[i].size(), i));
    for (int i = 1; i <= second; i++) {
      pair<int, int> t = q.top();
      q.pop();
      t.first--;
      a[*first[t.second].rbegin()] = t.second;
      first[t.second].pop_back();
      if (t.first) q.push(t);
    }
    cnt = 0;
    for (int i = 1; i <= n + 1; i++) {
      Max = max(Max, int(first[i].size()));
      for (int j : first[i]) X[cnt] = j, c[cnt++] = i;
    }
    for (int i = 0; i < cnt; i++) {
      Max %= cnt;
      if (second >= y) break;
      if (c[i] != c[Max]) {
        a[X[i]] = c[Max++];
        second++;
      }
    }
    for (int i = 1; i <= n + 1; i++) first[i].clear();
    while (!q.empty()) q.pop();
    if (second < y) {
      puts("NO");
      continue;
    }
    puts("YES");
    for (int i = 1; i <= n; i++) {
      if (!a[i]) a[i] = M;
      printf("%d ", a[i]);
    }
    puts("");
  }
  return 0;
}
