#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
#define x first
#define y second
const int N=210;
typedef pair<double,double>PII;
PII a[N];
int p[N];
struct edge{
int a,b;
double w;
}e[N*N];
bool cmp(edge a,edge b)
{
return a.w<b.w;
}
double get_dist(int i,int j)
{
int dx=a[i].x-a[j].x;
int dy=a[i].y-a[j].y;
return sqrt(dx*dx+dy*dy);
}
int find(int x)
{
if(p[x]!=x)
p[x]=find(p[x]);
return p[x];
}
int main()
{
int t;
cin>>t;
while(t--)
{
memset(p,0,sizeof p);
memset(e,0,sizeof e);
memset(a,0,sizeof a);
int n;
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i].x>>a[i].y;
for(int i=1;i<=n;i++)
p[i]=i;
int k=0;
for(int i=1;i<=n;i++)
for(int j=i+1;j<=n;j++)
{
double w=get_dist(i,j);
if(w>=10&&w<=1000)
e[k++]={i,j,w};
}
sort(e,e+k,cmp);
double sum=0;
for(int i=0;i<k;i++)
{
int a=find(e[i].a);
int b=find(e[i].b);
double w=e[i].w;
if(a!=b)
{
p[a]=b;
sum+=w;
}
}
int ans=0;
for(int i=1;i<=n;i++)
if(p[i]==p[1])
ans++;
if(ans==n)
printf("%.1f\n",sum*100);
else
cout<<"oh!"<<endl;
}
return 0;
}