#include<bits/stdc++.h>
#define ll long long int
#define f0n for(ll i=0;i<n;i++)
#define f1n for(ll i=1; i<=n; i++)
#define pb push_back
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;

int main(){
   
  IOS;
  ll t;
  cin>>t;
  while(t--)
  {
     ll n,l,r;
     cin>>n>>l>>r;
     ll a[n];
     multiset<ll> sl,sr;
     set<ll> st;
     f0n
     {
     	cin>>a[i];
     	st.insert(a[i]);
     	if(i<l) sl.insert(a[i]);
     	else sr.insert(a[i]);
	 }
	 ll cn=0,c1=(abs(r-l))/2,ans=0;
     ll cm=0;
	 if(l<=r)
	 { 
	 	for(auto it:sl)
	    {
	    	ll c=it;
	    	if(sr.find(c)==sr.end()) cn++;
	    	else sr.erase(sr.find(c));
	    }
	   while(sr.size()>0)
	   {
	   	  auto it=sr.begin();
	   	  sr.erase(sr.find(*it));
	   	  if(sr.find(*it)!=sr.end()) {cm++; sr.erase(sr.find(*it));}
	   	 }
	 }
	 else
	 {
	 		for(auto it:sr)
	    {
	    	ll c=it;
	    	if(sl.find(c)==sl.end()) cn++;
	    	else sl.erase(sl.find(c));
	    }
	    while(sl.size()>0)
	    {
	   auto it=sl.begin();
	   	  sl.erase(sl.find(*it));
	   	  if(sl.find(*it)!=sl.end()) {cm++; sl.erase(sl.find(*it));}
	   }
	 }
	 ll h=max(0ll,c1-cm);
	 cout<<c1+cn+h<<endl;
}
  return 0;
}