#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<ext/numeric>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;

typedef long long int i64;
typedef long long unsigned int u64;

#define ForEach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)

struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return hash<long long>()(((long long)x.first)^(((long long)x.second)<<32));
  }
};

int N;

//bool solve(const vector<int>& V, unordered_map<pair<int,int>, bool, HASH>& Cache, int p, int d, bool consume_forward){
bool solve(const vector<int>& V, vector<vector<int>>& Cache, int p, int d, bool consume_forward){
  //pair<int,int> x=make_pair(p,d);
  int n=V.size();
  if (Cache[p][N+d]!=-1) return Cache[p][N+d];
  //if (Cache.find(x)!=Cache.end()) return Cache[x];
  for (int i=1+p;i<n;++i){
    int diff=consume_forward?d-V[i]+V[p]:d+V[i]-V[p];
    if (diff>N||diff<-N)break;
    if (solve(V, Cache, i, consume_forward?d-V[i]+V[p]:d+V[i]-V[p], !consume_forward)){
      return Cache[p][N+d]=1;
      //return Cache[x]=true;
    }
  }
  bool result=((consume_forward?N-V[p]:V[p]-N)==d);
  //return Cache[x]=result;
  return Cache[p][N+d]=result;
}

int main(){
  int n_cases; scanf("%d",&n_cases);
  while(n_cases--){
    int m; scanf("%d",&m); N=m<<1;
    vector<int> V;
    int best=0;
    for (int i=0;i<N;++i){
      int x; scanf("%d",&x);
      if (x>best){
        V.push_back(i);
        best=x;
      }
    }
    int n=V.size();
    vector<vector<int>> Cache(n, vector<int>(2*N+1,-1));
    //unordered_map<pair<int,int>, bool, HASH> Cache;
    string answer=solve(V, Cache, 0, 0, true)?"YES":"NO";
    printf("%s\n",answer.c_str());
  }
  return 0;
}


#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<ext/numeric>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;

typedef long long int i64;
typedef long long unsigned int u64;

#define ForEach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)

struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return hash<long long>()(((long long)x.first)^(((long long)x.second)<<32));
  }
};

int N;

bool solve(const vector<int>& V, unordered_map<pair<int,int>, bool, HASH>& Cache, int p, int d, bool consume_forward){
  pair<int,int> x=make_pair(p,d);
  //if (Cache[p][n+d]!=-1) return Cache[p][n+d];
  if (Cache.find(x)!=Cache.end()) return Cache[x];
  for (int i=1+p;i<V.size();++i){
    if (solve(V, Cache, i, consume_forward?d-V[i]+V[p]:d+V[i]-V[p], !consume_forward)){
      //return Cache[p][n+d]=1;
      return Cache[x]=true;
    }
  }
  //return Cache[p][n+d]=(multiplier*(n-p)==d);
  bool result=((consume_forward?N-V[p]:V[p]-N)==d);
  return Cache[x]=result;
}

int main(){
  int n_cases; scanf("%d",&n_cases);
  while(n_cases--){
    int m; cin>>m; N=m<<1;
    vector<int> V;
    int best=0;
    for (int i=0;i<N;++i){
      int x; cin>>x;
      if (x>best){
        V.push_back(i);
        best=x;
      }
    }

    //vector<vector<int>> Cache(n, vector<int>(2*n+1, -1));
    unordered_map<pair<int,int>, bool, HASH> Cache;
    string answer=solve(V, Cache, 0, 0, true)?"YES":"NO";
    cout<<answer<<endl;
  }
  return 0;
}


#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<ext/numeric>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
using namespace std;

typedef long long int i64;
typedef long long unsigned int u64;

#define ForEach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)

// can we make diff of "d" and position "p". Final result we're interested in
// has diff 0 at position 0.
bool can_make(const vector<int>& V, vector<vector<int>>& Cache, int p, int d, int multiplier){
  int n=V.size();
  if (Cache[p][n+d]!=-1) return Cache[p][n+d];
  bool can_do=false;
  int highest_so_far=V[p];
  for (int i=1+p;i<n;++i){
    if (V[i]>highest_so_far){
      can_do|=can_make(V, Cache, i, d-multiplier*(i-p), -multiplier);
    }
    highest_so_far=max(highest_so_far,V[i]);
  }
  can_do |= (multiplier*(n-p)==d);
  return Cache[p][n+d]=can_do;
}

void solve_case(){
  int m; cin>>m; int n=2*m;
  vector<int> V(n);
  for (int i=0;i<n;++i) cin>>V[i];
  vector<vector<int>> Cache(n, vector<int>(2*n+1, -1));
  string answer=can_make(V, Cache, 0, 0, 1)?"YES":"NO";
  cout<<answer<<endl;
}

int main(){
  int n_cases;
  cin>>n_cases;
  while(n_cases--){
    solve_case();
  }
  return 0;
}


#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=4e3+10;
int T,n,m,ma,y,l,r,rmq[maxn][21],a[maxn],b[maxn],ind,lg2[maxn]={0,0},dp[maxn]={1};
inline int read()
{
    char c=getchar();int x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
int Query(int l,int r)
{
    int k=lg2[r-l+1];
    if (a[rmq[l][k]] > a[rmq[r-(1<<k)+1][k]]) return a[rmq[l][k]];
    else return rmq[r-(1<<k)+1][k];
}
int main() {
    for (int i=2;i<maxn;++i) lg2[i] = lg2[i>>1]+1;
    //scanf("%d %d", &n, &m);
    scanf("%d", &T);
	while (T--) {
		ind = 0;
		n = read();
		n *= 2;
		y = n;
    	for (int i=1;i<=n;++i) scanf("%d", &a[i]);
    	for (int i=1;i<=n;++i) dp[i] = 0;
    	/*for (int i=1;i<=n;++i) rmq[i][0] = i;
    	for (int j=1;j<=21;j++)
    	    for (int i=1;i+(1<<j)-1<=n;i++) {
    	    	if (a[rmq[i][j-1]] > a[rmq[i+(1<<(j-1))][j-1]]) {
    	    		rmq[i][j] = rmq[i][j-1];
    	    	}
    	    	else {
        			rmq[i][j] = rmq[i+(1<<(j-1))][j-1];
        		}
        	}*/
    	while (y) {
    		ma = a[y];
    		m = y;
    		for (int i=1;i<=y-1;++i) {
    			if (a[i] > ma) {
    				ma = a[i];
    				m = i;
    			}
    		}
    		b[++ind] = y-m+1;
    		y = m-1;
    	}
    	for (int i=1;i<=ind;++i) {
    		for (int j=n;j>=b[i];--j) {
    			if (dp[j-b[i]]) dp[j] = 1;
    		}
    	}
    	//for (int i=0;i<=n;++i) printf("%d\n", dp[i]);
    	if (dp[n/2]) printf("YES\n");
    	else printf("NO\n");
	}

    return 0;
}


#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn=4e3+10;
int T,n,m,y,a[maxn],b[maxn],ind,dp[maxn]={1};
int main() {
    scanf("%d", &T);
	while (T--) {
		scanf("%d", &n);
		ind = 0; n *= 2; y = n;
    	for (int i=1;i<=n;++i) {
    		scanf("%d", &a[i]);
    		dp[i] = 0;
    	}
    	while (y) {
    		m = y;
    		for (int i=1;i<=y-1;++i) {
    			if (a[i] > a[m]) {
    				m = i;
    			}
    		}
    		b[++ind] = y-m+1;
    		y = m-1;
    	}
    	for (int i=1;i<=ind;++i) {
    		for (int j=n;j>=b[i];--j) {
    			if (dp[j-b[i]]) dp[j] = 1;
    		}
    	}
    	if (dp[n/2]) printf("YES\n");
    	else printf("NO\n");
	}

    return 0;
}


#include<bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i <= (b); ++i)
#define fd(i, a, b) for (int i = (a); i >= (b); --i)
#define edge(i, u) for (int i = head[u], v = e[i].v; i; i = e[i].nxt, v = e[i].v)
#define mod 1000000009
#define ll long long
#define F first
#define S second
#define mp(i, j) std::make_pair(i, j)
#define ls t[u][0]
#define rs t[u][1]
#define Re register
#define inf 1e9
#define upn 100000
#define pb(x) push_back(x)
#define N 4005
#define pi std::pair<int, int>
ll read ()
{
    Re char ch = getchar();
    Re ll ret = 0;
    while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) {ret = ret * 10 + ch - '0'; ch = getchar();}
    return ret;
}
struct edge {
    int v, w, nxt;
//    friend bool operator < (edge x, edge y) {return x.w < y.w;}
}e[N << 1];
int tot, head[N];
void addedge (int u, int v, int w) { e[++tot] = (edge) {v, w, head[u]}; head[u] = tot; }
ll n, a[N], f[N], w[N], cnt, mx;
int main ()
{
    int t = read();
    while (t--)
    {
        scanf("%lld", &n);
        fo (i, 1, n << 1) a[i] = read();
        cnt = 0; mx = 0;
        fo (i, 1, n << 1)
            if (mx < a[i])
            {
                mx = a[i];
                ++cnt;
                w[cnt]++;
            }
            else
                w[cnt]++;
        memset(f, 0, sizeof f);
        f[0] = 1;
        fo (i, 1, cnt)
            fo (j, w[i], n << 1)
                f[j] |= f[j - w[i]];
        if (f[n])
            printf("YES\n");
        else
            printf("NO\n");
    }
}


#include<bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i <= (b); ++i)
#define fd(i, a, b) for (int i = (a); i >= (b); --i)
#define edge(i, u) for (int i = head[u], v = e[i].v; i; i = e[i].nxt, v = e[i].v)
#define mod 1000000009
#define ll long long
#define F first
#define S second
#define mp(i, j) std::make_pair(i, j)
#define ls t[u][0]
#define rs t[u][1]
#define Re register
#define inf 1e9
#define upn 100000
#define pb(x) push_back(x)
#define N 4005
#define pi std::pair<int, int>
ll read ()
{
    Re char ch = getchar();
    Re ll ret = 0;
    while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) {ret = ret * 10 + ch - '0'; ch = getchar();}
    return ret;
}
struct edge {
    int v, w, nxt;
//    friend bool operator < (edge x, edge y) {return x.w < y.w;}
}e[N << 1];
int tot, head[N];
void addedge (int u, int v, int w) { e[++tot] = (edge) {v, w, head[u]}; head[u] = tot; }
ll n, a[N], f[N], w[N], cnt, mx;
int main ()
{
    int t = read();
    while (t--)
    {
        scanf("%lld", &n);
        fo (i, 1, n << 1) a[i] = read();
        cnt = 0; mx = 0;
        fo (i, 1, n << 1)
            if (mx < a[i])
            {
                mx = a[i];
                ++cnt;
                w[cnt] = 1;
            }
            else
                w[cnt]++;
        memset(f, 0, sizeof f);
        f[0] = 1;
        fo (i, 1, cnt)
            fd (j, n << 1, w[i])
                f[j] |= f[j - w[i]];
        if (f[n])
            printf("YES\n");
        else
            printf("NO\n");
    }
}


#include<bits/stdc++.h>
using namespace std;

long long n,t,tmp,a[2005],pos[2005],ans;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>t;
	for(int rr=0;rr<t;rr++)
	{
		cin>>n;
		bitset<4005>b,dp[4005];
		vector<long long>v;
		for(int i=1;i<=2*n;i++)
		{
			cin>>a[i];
			pos[a[i]]=i;
		}
		for(int i=2*n;i>=1;i--)
		{
			if(!b[i])
			{
				ans=0;
				tmp=pos[i];
				while(!b[a[tmp]]&&tmp<=2*n)
				{
					b[a[tmp]]=true;
					tmp++;
					ans++;
				}
				v.push_back(ans);
			}
		}
		dp[0][v[0]]=true;
		dp[0][0]=true;
		for(int i=1;i<v.size();i++)
		{
			for(int j=0;j<=n;j++)
			{
				if(dp[i-1][j])
				{
					dp[i][j]=true;
					dp[i][j+v[i]]=true;
				}
			}
		}
		if(dp[v.size()-1][n])
		{
			cout<<"YES\n";
		}
		else
		{
			cout<<"NO\n";
		}
	}
}


#include<bits/stdc++.h>
using namespace std;

long long n,t,tmp,a[2005],pos[2005],ans;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>t;
	for(int rr=0;rr<t;rr++)
	{
		cin>>n;
		bitset<2005>b,dp[2005];
		vector<long long>v;
		for(int i=1;i<=2*n;i++)
		{
			cin>>a[i];
			pos[a[i]]=i;
		}
		for(int i=2*n;i>=1;i--)
		{
			if(!b[i])
			{
				ans=0;
				tmp=pos[i];
				while(!b[a[tmp]]&&tmp<=2*n)
				{
					b[a[tmp]]=true;
					tmp++;
					ans++;
				}
				v.push_back(ans);
			}
		}
		dp[0][v[0]]=true;
		dp[0][0]=true;
		for(int i=1;i<v.size();i++)
		{
			for(int j=0;j<=n;j++)
			{
				if(dp[i-1][j])
				{
					dp[i][j]=true;
					dp[i][j+v[i]]=true;
				}
			}
		}
		if(dp[v.size()-1][n])
		{
			cout<<"YES\n";
		}
		else
		{
			cout<<"NO\n";
		}
	}
}


#include<bits/stdc++.h>
using namespace std;

long long n,t,tmp,a[4005],pos[4005],ans;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>t;
	for(int rr=0;rr<t;rr++)
	{
		cin>>n;
		bitset<4005>b,dp[4005];
		vector<long long>v;
		for(int i=1;i<=2*n;i++)
		{
			cin>>a[i];
			pos[a[i]]=i;
		}
		for(int i=2*n;i>=1;i--)
		{
			if(!b[i])
			{
				ans=0;
				tmp=pos[i];
				while(!b[a[tmp]]&&tmp<=2*n)
				{
					b[a[tmp]]=true;
					tmp++;
					ans++;
				}
				v.push_back(ans);
			}
		}
		dp[0][v[0]]=true;
		dp[0][0]=true;
		for(int i=1;i<v.size();i++)
		{
			for(int j=0;j<=n;j++)
			{
				if(dp[i-1][j])
				{
					dp[i][j]=true;
					dp[i][j+v[i]]=true;
				}
			}
		}
		if(dp[v.size()-1][n])
		{
			cout<<"YES\n";
		}
		else
		{
			cout<<"NO\n";
		}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>(Collections.reverseOrder(Arrays::compare));
            for (int k : map.keySet()) {
                pq.add(new int[] {map.get(k).size(), k});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[1]).remove(pair[0]-1));
                pair[0]--;
                pq.add(pair);
            }
            ArrayList<Integer> shift = new ArrayList<>();
            for (int k : map.keySet()) {
                shift.addAll(map.get(k));
            }
            int delta = (n-x)/2;
            Collections.sort(shift, (a, b) -> Integer.compare(arr[a], arr[b]));
            HashSet<Integer> forced = new HashSet<>();
            for (int i = 0; i < shift.size(); i++) {
                if (arr[shift.get(i)] == arr[shift.get((i+delta)%shift.size())]) {
                    forced.add(shift.get((i+delta)%shift.size()));
                }
            }
            if (forced.size() > n-y) {
                out.println("NO");
                continue;
            }
            int[] ans = new int[n];
            for (int i : same) {
                ans[i] = arr[i];
            }
            for (int i = 0; i < shift.size(); i++) {
                ans[shift.get((i+delta)%shift.size())] = arr[shift.get(i)];
            }
            HashSet<Integer> set = new HashSet<>();
            for (int a : arr) {
                set.add(a);
            }
            int c;
            for (c = 1; c <= n+1; c++) {
                if (!set.contains(c)) {
                    break;
                }
            }
            for (int i : forced) {
                ans[i] = c;
            }
            int count = forced.size();
            for (int i = 0; i < n-y && count < n-y; i++) {
                if (!forced.contains(shift.get(i))) {
                    ans[shift.get(i)] = c;
                    count++;
                }
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>(Collections.reverseOrder(Arrays::compare));
            for (int k : map.keySet()) {
                pq.add(new int[] {map.get(k).size(), k});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[1]).remove(pair[0]-1));
                pair[0]--;
                pq.add(pair);
            }
            ArrayList<Integer> shift = new ArrayList<>();
            for (int k : map.keySet()) {
                shift.addAll(map.get(k));
            }
            int delta = (n-x)/2;
            Collections.sort(shift, (a, b) -> Integer.compare(arr[a], arr[b]));
            ArrayList<Integer> forced = new ArrayList<>();
            for (int i = 0; i < shift.size(); i++) {
                if (arr[shift.get(i)] == arr[shift.get((i+delta)%shift.size())]) {
                    forced.add(shift.get((i+delta)%shift.size()));
                }
            }
            if (forced.size() > n-y) {
                out.println("NO");
                continue;
            }
            int[] ans = new int[n];
            for (int i : same) {
                ans[i] = arr[i];
            }
            for (int i = 0; i < shift.size(); i++) {
                ans[shift.get((i+delta)%shift.size())] = arr[shift.get(i)];
            }
            HashSet<Integer> set = new HashSet<>();
            for (int a : arr) {
                set.add(a);
            }
            int c;
            for (c = 1; c <= n+1; c++) {
                if (!set.contains(c)) {
                    break;
                }
            }
            for (int i : forced) {
                ans[i] = c;
            }
            for (int i = forced.size(); i < n-y; i++) {
                ans[shift.get(i)] = c;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            if (y == n && x == n-1) {
                out.println("NO");
                continue;
            }
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return b[1] - a[1];
            });
            for (int k : map.keySet()) {
                pq.add(new int[] {k, map.get(k).size()});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq.add(pair);
            }
            // out.println(map);
            // out.println(same);
            // out.println(Arrays.toString(pq.peek()));
            PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return a[1] - b[1];
            });
            while (!pq.isEmpty()) {
                pq2.add(pq.remove());
            }
            ArrayList<Integer> shuf = new ArrayList<>();
            for (int i = x; i < y; i++) {
                int[] pair = pq2.remove();
                while (pair[1] == 0) {
                    pair = pq2.remove();
                }
                shuf.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq2.add(pair);
            }
            // out.println(same);
            // out.println(shuf);
            ArrayList<Integer> remain = new ArrayList<>();
            for (int k : map.keySet()) {
                remain.addAll(map.get(k));
            }
            if (shuf.size() % 2 == 1 && !remain.isEmpty()) {
                shuf.add(remain.get(0));
            }
            HashMap<Integer, Integer> freq = new HashMap<>();
            int max = 0;
            for (int a : shuf) {
                freq.put(arr[a], freq.getOrDefault(arr[a], 0) + 1);
                max = Math.max(max, freq.get(arr[a]));
            }
            // if (max > shuf.size()/2) {
            //     out.println("NO");
            //     continue;
            // }
            Collections.sort(shuf, (a, b) -> Integer.compare(arr[a], arr[b]));
            int[] ans = new int[n];
            for (int a : same) {
                ans[a] = arr[a];
            }
            for (int i = 0; i < shuf.size(); i++) {
                ans[shuf.get(i)] = arr[shuf.get((i+max)%shuf.size())];
            }
            int rep = 1;
            for (; rep <= n+1; rep++) {
                if (!map.containsKey(rep)) {
                    break;
                }
            }
            for (int r : remain) {
                ans[r] = rep;
            }

            if (!check(arr, ans, x, y)) {
                // out.println("WRONG ANSWER");
                // out.printf("%d %d %d%n", n, x, y);
                // out.println(Arrays.toString(arr));
                // out.println(Arrays.toString(ans));
                // for (int k : shuf) {
                //     out.print(arr[k]);
                //     out.print(" ");
                // }
                // out.println();
                // out.println("SAME " + same);
                // out.println("SHUF " + shuf);
                // return;
                out.println("NO");
            } else {
                out.println("YES");
                for (int a : ans) {
                    out.print(a);
                    out.print(" ");
                }
                out.println();
            }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>(Collections.reverseOrder(Arrays::compare));
            for (int k : map.keySet()) {
                pq.add(new int[] {map.get(k).size(), k});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[1]).remove(pair[0]-1));
                pair[0]--;
                pq.add(pair);
            }
            ArrayList<Integer> shift = new ArrayList<>();
            for (int k : map.keySet()) {
                shift.addAll(map.get(k));
            }
            int delta = (n-x)/2;
            Collections.sort(shift, (a, b) -> Integer.compare(arr[a], arr[b]));
            ArrayList<Integer> forced = new ArrayList<>();
            for (int i = 0; i < shift.size(); i++) {
                if (arr[shift.get(i)] == arr[shift.get((i+delta)%shift.size())]) {
                    forced.add(shift.get((i+delta)%shift.size()));
                }
            }
            if (forced.size() > n-y) {
                out.println("NO");
                continue;
            }
            int[] ans = new int[n];
            for (int i : same) {
                ans[i] = arr[i];
            }
            for (int i = 0; i < shift.size(); i++) {
                ans[shift.get((i+delta)%shift.size())] = arr[shift.get(i)];
            }
            HashSet<Integer> set = new HashSet<>();
            for (int a : arr) {
                set.add(a);
            }
            int c;
            for (c = 1; c <= n+1; c++) {
                if (!set.contains(c)) {
                    break;
                }
            }
            for (int i = 0; i < n-y; i++) {
                ans[shift.get(i)] = c;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            if (y == n && x == n-1) {
                out.println("NO");
                continue;
            }
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return b[1] - a[1];
            });
            for (int k : map.keySet()) {
                pq.add(new int[] {k, map.get(k).size()});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq.add(pair);
            }
            // out.println(map);
            // out.println(same);
            // out.println(Arrays.toString(pq.peek()));
            PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return a[1] - b[1];
            });
            while (!pq.isEmpty()) {
                pq2.add(pq.remove());
            }
            ArrayList<Integer> shuf = new ArrayList<>();
            for (int i = x; i < y; i++) {
                int[] pair = pq2.remove();
                while (pair[1] == 0) {
                    pair = pq2.remove();
                }
                shuf.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq2.add(pair);
            }
            // out.println(same);
            // out.println(shuf);
            ArrayList<Integer> remain = new ArrayList<>();
            for (int k : map.keySet()) {
                remain.addAll(map.get(k));
            }
            if (shuf.size() % 2 == 1 && !remain.isEmpty()) {
                shuf.add(remain.get(0));
            }
            HashMap<Integer, Integer> freq = new HashMap<>();
            int max = 0;
            for (int a : shuf) {
                freq.put(arr[a], freq.getOrDefault(arr[a], 0) + 1);
                max = Math.max(max, freq.get(arr[a]));
            }
            if (max > shuf.size()/2) {
                out.println("NO");
                continue;
            }
            Collections.sort(shuf, (a, b) -> Integer.compare(arr[a], arr[b]));
            int[] ans = new int[n];
            for (int a : same) {
                ans[a] = arr[a];
            }
            for (int i = 0; i < shuf.size(); i++) {
                ans[shuf.get(i)] = arr[shuf.get((i+max)%shuf.size())];
            }
            int rep = 1;
            for (; rep <= n+1; rep++) {
                if (!map.containsKey(rep)) {
                    break;
                }
            }
            for (int r : remain) {
                ans[r] = rep;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     for (int k : shuf) {
            //         out.print(arr[k]);
            //         out.print(" ");
            //     }
            //     out.println();
            //     out.println("SAME " + same);
            //     out.println("SHUF " + shuf);
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            if (y == n && x == n-1) {
                out.println("NO");
                continue;
            }
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return b[1] - a[1];
            });
            for (int k : map.keySet()) {
                pq.add(new int[] {k, map.get(k).size()});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq.add(pair);
            }
            // out.println(map);
            // out.println(same);
            // out.println(Arrays.toString(pq.peek()));
            if (n-x-pq.peek()[1] < (y-x+1)/2) {
                out.println("NO");
                continue;
            }
            PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return a[1] - b[1];
            });
            while (!pq.isEmpty()) {
                pq2.add(pq.remove());
            }
            ArrayList<Integer> shuf = new ArrayList<>();
            for (int i = x; i < y; i++) {
                int[] pair = pq2.remove();
                while (pair[1] == 0) {
                    pair = pq2.remove();
                }
                shuf.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq2.add(pair);
            }
            // out.println(same);
            // out.println(shuf);
            ArrayList<Integer> remain = new ArrayList<>();
            for (int k : map.keySet()) {
                remain.addAll(map.get(k));
            }
            if (shuf.size() % 2 == 1 && !remain.isEmpty()) {
                shuf.add(remain.get(0));
            }
            Collections.sort(shuf, (a, b) -> Integer.compare(arr[a], arr[b]));
            Collections.rotate(shuf, shuf.size()/2);
            int[] ans = new int[n];
            for (int a : same) {
                ans[a] = arr[a];
            }
            for (int i = 0; i < shuf.size(); i++) {
                ans[shuf.get(i)] = arr[shuf.get(shuf.size()-1-i)];
            }
            int rep = 1;
            for (; rep <= n+1; rep++) {
                if (!map.containsKey(rep)) {
                    break;
                }
            }
            for (int r : remain) {
                ans[r] = rep;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();
        }
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            if (y == n && x == n-1) {
                out.println("NO");
                continue;
            }
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return b[1] - a[1];
            });
            for (int k : map.keySet()) {
                pq.add(new int[] {k, map.get(k).size()});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq.add(pair);
            }
            // out.println(map);
            // out.println(same);
            // out.println(Arrays.toString(pq.peek()));
            PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return a[1] - b[1];
            });
            while (!pq.isEmpty()) {
                pq2.add(pq.remove());
            }
            ArrayList<Integer> shuf = new ArrayList<>();
            for (int i = x; i < y; i++) {
                int[] pair = pq2.remove();
                while (pair[1] == 0) {
                    pair = pq2.remove();
                }
                shuf.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq2.add(pair);
            }
            // out.println(same);
            // out.println(shuf);
            ArrayList<Integer> remain = new ArrayList<>();
            for (int k : map.keySet()) {
                remain.addAll(map.get(k));
            }
            if (shuf.size() % 2 == 1 && !remain.isEmpty()) {
                shuf.add(remain.get(0));
            }
            HashMap<Integer, Integer> freq = new HashMap<>();
            int max = 0;
            for (int a : shuf) {
                freq.put(arr[a], freq.getOrDefault(arr[a], 0) + 1);
                max = Math.max(max, freq.get(arr[a]));
            }
            if (max > shuf.size()/2) {
                out.println("NO");
                continue;
            }
            Collections.sort(shuf, (a, b) -> Integer.compare(arr[a], arr[b]));
            Collections.rotate(shuf, shuf.size()/2);
            int[] ans = new int[n];
            for (int a : same) {
                ans[a] = arr[a];
            }
            for (int i = 0; i < shuf.size(); i++) {
                ans[shuf.get(i)] = arr[shuf.get(shuf.size()-1-i)];
            }
            int rep = 1;
            for (; rep <= n+1; rep++) {
                if (!map.containsKey(rep)) {
                    break;
                }
            }
            for (int r : remain) {
                ans[r] = rep;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();
        }
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>(Collections.reverseOrder(Arrays::compare));
            for (int k : map.keySet()) {
                pq.add(new int[] {map.get(k).size(), k});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[1]).remove(pair[0]-1));
                pair[0]--;
                pq.add(pair);
            }
            ArrayList<Integer> shift = new ArrayList<>();
            for (int k : map.keySet()) {
                shift.addAll(map.get(k));
            }
            int delta = (n-x)/2;
            Collections.sort(shift, (a, b) -> Integer.compare(arr[a], arr[b]));
            ArrayList<Integer> forced = new ArrayList<>();
            for (int i = 0; i < shift.size(); i++) {
                if (arr[shift.get(i)] == arr[shift.get((i+delta)%shift.size())]) {
                    forced.add(shift.get((i+delta)%shift.size()));
                }
            }
            if (forced.size() > n-y) {
                out.println("NO");
                continue;
            }
            int[] ans = new int[n];
            for (int i : same) {
                ans[i] = arr[i];
            }
            for (int i = 0; i < shift.size(); i++) {
                ans[shift.get((i+delta)%shift.size())] = arr[shift.get(i)];
            }
            HashSet<Integer> set = new HashSet<>();
            for (int a : arr) {
                set.add(a);
            }
            int c;
            for (c = 1; c <= n+1; c++) {
                if (!set.contains(c)) {
                    break;
                }
            }
            for (int i = 0; i < n-y; i++) {
                ans[shift.get(i)] = c;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class C {
    static final boolean RUN_TIMING = false;
    static char[] inputBuffer = new char[1 << 20];
    static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public void go() throws IOException {
        // in = new PushbackReader(new BufferedReader(new FileReader(new File("test.txt"))), 1 << 20);
        // out = new PrintWriter(new FileWriter(new File("output.txt")));
        int zzz = ipar();
        for (int zz = 0; zz < zzz; zz++) {
            int n = ipar();
            int x = ipar();
            int y = ipar();
            int[] arr = iapar(n);
            // if (y == n && x == n-1) {
            //     out.println("NO");
            //     continue;
            // }
            HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (!map.containsKey(arr[i])) {
                    map.put(arr[i], new ArrayList<>());
                }
                map.get(arr[i]).add(i);
            }
            PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return b[1] - a[1];
            });
            for (int k : map.keySet()) {
                pq.add(new int[] {k, map.get(k).size()});
            }
            ArrayList<Integer> same = new ArrayList<>();
            for (int i = 0; i < x; i++) {
                int[] pair = pq.remove();
                same.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq.add(pair);
            }
            // out.println(map);
            // out.println(same);
            // out.println(Arrays.toString(pq.peek()));
            PriorityQueue<int[]> pq2 = new PriorityQueue<>((a, b) -> {
                if (a[1] == b[1]) {
                    return a[0] - b[0];
                }
                return a[1] - b[1];
            });
            while (!pq.isEmpty()) {
                pq2.add(pq.remove());
            }
            ArrayList<Integer> shuf = new ArrayList<>();
            for (int i = x; i < y; i++) {
                int[] pair = pq2.remove();
                while (pair[1] == 0) {
                    pair = pq2.remove();
                }
                shuf.add(map.get(pair[0]).remove(pair[1]-1));
                pair[1]--;
                pq2.add(pair);
            }
            // out.println(same);
            // out.println(shuf);
            ArrayList<Integer> remain = new ArrayList<>();
            for (int k : map.keySet()) {
                remain.addAll(map.get(k));
            }
            if (shuf.size() % 2 == 1 && !remain.isEmpty()) {
                shuf.add(remain.get(0));
            }
            HashMap<Integer, Integer> freq = new HashMap<>();
            int max = 0;
            for (int a : shuf) {
                freq.put(arr[a], freq.getOrDefault(arr[a], 0) + 1);
                max = Math.max(max, freq.get(arr[a]));
            }
            if (max > shuf.size()/2) {
                out.println("NO");
                continue;
            }
            Collections.sort(shuf, (a, b) -> Integer.compare(arr[a], arr[b]));
            int[] ans = new int[n];
            for (int a : same) {
                ans[a] = arr[a];
            }
            for (int i = 0; i < shuf.size(); i++) {
                ans[shuf.get(i)] = arr[shuf.get((i+max)%shuf.size())];
            }
            int rep = 1;
            for (; rep <= n+1; rep++) {
                if (!map.containsKey(rep)) {
                    break;
                }
            }
            for (int r : remain) {
                ans[r] = rep;
            }
            out.println("YES");
            for (int a : ans) {
                out.print(a);
                out.print(" ");
            }
            out.println();

            // if (!check(arr, ans, x, y)) {
            //     out.println("WRONG ANSWER");
            //     out.printf("%d %d %d%n", n, x, y);
            //     out.println(Arrays.toString(arr));
            //     out.println(Arrays.toString(ans));
            //     for (int k : shuf) {
            //         out.print(arr[k]);
            //         out.print(" ");
            //     }
            //     out.println();
            //     out.println("SAME " + same);
            //     out.println("SHUF " + shuf);
            //     return;
            // }
        }
    }

    public boolean check(int[] arr, int[] ans, int x, int y) {
        int n = arr.length;
        int same = 0;
        int notContains = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] == ans[i]) {
                same++;
            }
        }
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int a : arr) {
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        for (int a : ans) {
            if (map.containsKey(a)) {
                map.put(a, map.get(a)-1);
                if (map.get(a) == 0) {
                    map.remove(a);
                }
            }
        }
        for (int k : map.keySet()) {
            notContains += map.get(k);
        }
        return same == x && notContains == n-y;
    }

    public int ipar() throws IOException {
        return Integer.parseInt(spar());
    }

    public int[] iapar(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar() throws IOException {
        return Long.parseLong(spar());
    }

    public long[] lapar(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar() throws IOException {
        return Double.parseDouble(spar());
    }

    public String spar() throws IOException {
        int len = 0;
        int c;
        do {
            c = in.read();
        } while (Character.isWhitespace(c) && c != -1);
        if (c == -1) {
            throw new NoSuchElementException("Reached EOF");
        }
        do {
            inputBuffer[len] = (char)c;
            len++;
            c = in.read();
        } while (!Character.isWhitespace(c) && c != -1);
        while (c != '\n' && Character.isWhitespace(c) && c != -1) {
            c = in.read();
        }
        if (c != -1 && c != '\n') {
            in.unread(c);
        }
        return new String(inputBuffer, 0, len);
    }

    public String linepar() throws IOException {
        int len = 0;
        int c;
        while ((c = in.read()) != '\n' && c != -1) {
            if (c == '\r') {
                continue;
            }
            inputBuffer[len] = (char)c;
            len++;
        }
        return new String(inputBuffer, 0, len);
    }

    public boolean haspar() throws IOException {
        String line = linepar();
        if (line.isEmpty()) {
            return false;
        }
        in.unread('\n');
        in.unread(line.toCharArray());
        return true;
    }

    public void shuffle(int[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(long[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public void shuffle(Object[] arr) throws IOException {
        int n = arr.length;
        for (int i = 0; i < n; i++) {
            int j = (int)(Math.random() * (n-i) + i);
            Object temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
    }

    public static void main(String[] args) throws IOException {
        long time = 0;
        time -= System.nanoTime();
        new C().go();
        time += System.nanoTime();
        if (RUN_TIMING) {
            System.out.printf("%.3f ms%n", time / 1000000.0);
        }
        out.flush();
        in.close();
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

// 7:15.165 +

public class cf1381c {

    public static void main(String[] args) throws IOException {
        int t = ri();
        while (t --> 0) {
            int n = rni(), x = ni(), y = ni() - x, b[] = ria(n), ans[] = new int[n], filler = 1;
            fill(ans, -1);
            Map<Integer, Queue<Integer>> inds = new HashMap<>();
            for (int i = 0; i < n; ++i) {
                inds.computeIfAbsent(b[i], key -> new LinkedList<>()).offer(i);
                while (inds.containsKey(filler)) {
                    ++filler;
                }
            }
            PriorityQueue<int[]> selection = new PriorityQueue<>((aa, bb) -> bb[1] - aa[1]);
            for (int key : inds.keySet()) {
                selection.offer(new int[] {key, inds.get(key).size()});
            }
            for (int i = 0; i < x; ++i) {
                int select[] = selection.poll(), num = select[0], count = select[1];
                ans[inds.get(num).peek()] = b[inds.get(num).poll()];
                if (count > 1) {
                    selection.offer(new int[] {num, count - 1});
                }
            }
            if (x < n) {
                if (selection.peek()[1] > (n - x) / 2 && selection.peek()[1] + y > n - x) {
                    prN();
                    continue;
                }
                int max = selection.peek()[1], dummy[] = new int[n];
                List<Integer> indices = new ArrayList<>();
                while (!selection.isEmpty()) {
                    int select[] = selection.poll(), num = select[0], count = select[1];
                    for (int i = 0; i < count; ++i) {
                        indices.add(inds.get(num).peek());
                        if (y --> 0) {
                            dummy[inds.get(num).peek()] = b[inds.get(num).poll()];
                        } else {
                            dummy[inds.get(num).poll()] = filler;
                        }
                    }
                }
                // rotation to mismatch
                for (int i = 0; i < n - x; ++i) {
                    ans[indices.get((i + max) % (n - x))] = dummy[indices.get(i)];
                }
            }
            prY();
            prln(ans);
        }
        close();
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random __rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e9
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return min(x[0], x[1]); if (x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if (x.length == 1) return x[0]; if (x.length == 2) return max(x[0], x[1]); if (x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for (int i = 1; i < x.length; ++i) if (x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if (a == 0) return 0; int ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if (a == 0) return 0; long ans = 1; while (b > 0) {if ((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int) d;}
    static int cei(double d) {return (int) ceil(d);}
    static long fll(double d) {return (long) d;}
    static long cel(double d) {return (long) ceil(d);}
    static int gcf(int a, int b) {return b == 0 ? a : gcf(b, a % b);}
    static long gcf(long a, long b) {return b == 0 ? a : gcf(b, a % b);}
    static int lcm(int a, int b) {return a * b / gcf(a, b);}
    static long lcm(long a, long b) {return a * b / gcf(a, b);}
    static int randInt(int min, int max) {return __rand.nextInt(max - min + 1) + min;}
    static long mix(long x) {x += 0x9e3779b97f4a7c15L; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9L; x = (x ^ (x >> 27)) * 0x94d049bb133111ebL; return x ^ (x >> 31);}
    // array util
    static void reverse(int[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(double[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {double swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for (int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(double[] a) {int n = a.length - 1; for (int i = 0; i < n; ++i) {int ind = randInt(i, n); double swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static void rsort(double[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static double[] copy(double[] a) {double[] ans = new double[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for (int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    // graph util
    static List<List<Integer>> g(int n) {List<List<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<Set<Integer>> sg(int n) {List<Set<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static void c(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void cto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dc(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dcto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(rline());}
    static int ri() throws IOException {return Integer.parseInt(rline());}
    static long rl() throws IOException {return Long.parseLong(rline());}
    static double rd() throws IOException {return Double.parseDouble(rline());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni(); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; r(); for (int i = 0; i < n; ++i) a[i] = ni() - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; r(); for (int i = 0; i < n; ++i) a[i] = nl(); return a;}
    static double[] rda(int n) throws IOException {double[] a = new double[n]; r(); for (int i = 0; i < n; ++i) a[i] = nd(); return a;}
    static char[] rcha() throws IOException {return rline().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static String n() {return input.nextToken();}
    static int rni() throws IOException {r(); return ni();}
    static int ni() {return Integer.parseInt(n());}
    static long rnl() throws IOException {r(); return nl();}
    static long nl() {return Long.parseLong(n());}
    static double rnd() throws IOException {r(); return nd();}
    static double nd() {return Double.parseDouble(n());}
    static List<List<Integer>> rg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<List<Integer>> rdg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdg(List<List<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rdsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdsg(List<Set<Integer>> g, int m) throws IOException {for (int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {prln("yes");}
    static void pry() {prln("Yes");}
    static void prY() {prln("YES");}
    static void prno() {prln("no");}
    static void prn() {prln("No");}
    static void prN() {prln("NO");}
    static void pryesno(boolean b) {prln(b ? "yes" : "no");};
    static void pryn(boolean b) {prln(b ? "Yes" : "No");}
    static void prYN(boolean b) {prln(b ? "YES" : "NO");}
    static void prln(int... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(long... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static void prln(double... a) {for (int i = 0, len = a.length - 1; i < len; pr(a[i]), pr(' '), ++i); if (a.length > 0) prln(a[a.length - 1]); else prln();}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for (int i = 0; i < n; pr(iter.next()), pr(' '), ++i); if (n >= 0) prln(iter.next()); else prln();}
    static void h() {prln("hlfd"); flush();}
    static void flush() {__out.flush();}
    static void close() {__out.close();}}