/*
* 并查集+最小生成数
*/
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
#define MAXN 101
#define MAXM 9999
#define INF 0x3f3f3f3f
#define LIMITUP 1000
#define LIMITDOWN 10
struct Edge {
int u, v;
double w;
}edge[MAXM];
int dx[MAXN], dy[MAXN], e_cnt, root[MAXN], hash[MAXN];
void insert_arc(int u, int v, double w)
{
edge[e_cnt].u = u; edge[e_cnt].v = v;
edge[e_cnt ++].w = w;
}
int get_root(int x)
{
if( x == root[x] ) {
return x;
}
return root[x] = get_root(root[x]);
}
int cmp(const struct Edge &a, const struct Edge &b)
{
return a.w < b.w;
}
int can_connect(int a, int b, double &d)
{
d = sqrt((double)(dx[a]-dx[b])*(dx[a]-dx[b])+(double)(dy[a]-dy[b])*(dy[a]-dy[b]));
if( d >= LIMITDOWN && d <= LIMITUP ) {
return 1;
}
return 0;
}
double min_panning_tree(int vertex)
{
double ans(0.0);
int rx, ry;
for(int i = 0; i < vertex; i ++) {
root[i] = i;
}
for(int i = 1; i < vertex; i ++) {
for(int j = 0; j < e_cnt; j ++) {
rx = get_root(edge[j].u); ry = get_root(edge[j].v);
if( rx != ry ) {
root[rx] = ry;
ans += edge[j].w;
break;
}
}
}
return ans*100.0;
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
freopen("test.in", "r", stdin);
#endif
int cas, n, x, y, rx, ry, ans;
double d;
scanf("%d", &cas);
while( cas -- ) {
scanf("%d", &n); e_cnt = 0;
for(int i = 0; i < n; i ++) {
scanf("%d %d", &dx[i], &dy[i]);
root[i] = i;
}
for(int i = 0; i < n; i ++) {
for(int j = i+1; j < n; j ++) {
if( can_connect(i, j, d) ) {
insert_arc(i, j, d);
rx = get_root(i); ry = get_root(j);
if( rx != ry ) {
root[rx] = ry;
}
}
}
}
ans = 0; memset(hash, 0, sizeof(hash));
for(int i = 0; i < n; i ++) {
root[i] = get_root(i);
hash[ root[i] ] ++;
}
for(int i = 0; i < n; i ++) {
if( hash[i] ) {
ans ++;
}
}
if( 1 != ans ) {
printf("oh!\n"); continue;
}
sort(edge, edge+e_cnt, cmp);
printf("%.1lf\n", min_panning_tree(n));
}
return 0;
}