# Help me to find why it is giving wrong answer "PHYSICAL EXERCISE"

#include<bits/stdc++.h>
#define ll long long int
#define pll pair <ll,ll>
#define vll vector
#define vpl vector
#define s second
#define f first

using namespace std;

ll temp;

long double mmin(long double a,long double b)
{
if(a<b)return a;
return b;
}
void solve()
{
ll n,m,k,x,y;
cin>>x>>y;
cin>>n>>m>>k;
long double A,B;
pair<long double,long double> arr[n],brr[m],crr[k];
for(ll i=0;i<n;i++)cin>>A>>B,arr[i]=make_pair(A,B);
for(ll i=0;i<m;i++)cin>>A>>B,brr[i]=make_pair(A,B);
for(ll i=0;i<k;i++)cin>>A>>B,crr[i]=make_pair(A,B);

``````    long double ans=9223372036854775807;
long double a[n],b[k];

for(ll i=0;i<n;i++)
{
A=x-arr[i].f;
B=y-arr[i].s;
a[i]=sqrtl(A*A+B*B);
}

for(ll i=0;i<m;i++)
{
A=x-brr[i].f;
B=y-brr[i].s;
b[i]=sqrtl(A*A+B*B);
}

long double b1[m];
for(ll i=0;i<m;i++)
{
long double mini=ans;
for(ll j=0;j<k;j++)
{
A=brr[i].f-crr[j].f;
B=brr[i].s-crr[j].s;
mini=mmin(mini,A*A+B*B);
}
b1[i]=sqrtl(mini);
}
long double a1[m];
for(ll i=0;i<n;i++)
{
long double mini=ans;
for(ll j=0;j<k;j++)
{
A=arr[i].f-crr[j].f;
B=arr[i].s-crr[j].s;
mini=mmin(mini,A*A+B*B);
}
a1[i]=sqrtl(mini);
}

long double mini=ans;

for(ll i=0;i<n;i++)
{
for(ll j=0;j<m;j++)
{
A=arr[i].f-brr[j].f;
B=arr[i].s-brr[j].s;
A=sqrtl(A*A+B*B);

mini=mmin(mini,mmin(a[i]+A+b1[j],b[j]+A+a1[i]));
}
}

cout<<fixed<<setprecision(12)<<mini<<"\n";
``````

}

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);

``````    int t;
cin>>t;
while(t--)solve();
return 0;
``````

}