/* The Minimum Spanning Tree only needs to set the edge of the graph smaller than 10 or greater than 1000 as INF,
*/
# Include <cstdio>
# Include <cstring>
# Include <cmath>
# Define INF 1 <30
Int n, m, vis [110];
Double low [110];
Double map [110] [110];
Struct Node
{
Double x, y;
} A [110];
Int init ()
{
For (int I = 1; I <= n; I ++)
For (int j = 1; j <= n; j ++)
Map [I] [j] = INF;
Memset (vis, 0, sizeof (vis ));
}
Double dis (int I, int j)
{
Return sqrt (a [I]. x-a [j]. x) * (a [I]. x-a [j]. x) + (a [I]. y-a [j]. y) * (a [I]. y-a [j]. y ));
}
Double prim ()
{
Double ans = 0;
For (int I = 0; I <= n; I ++)
Low [I] = map [1] [I];
Vis [1] = 1;
For (int I = 1; I <n; I ++)
{
Int temp = INF, pos =-1;
For (int j = 1; j <= n; j ++)
If (temp> low [j] &! Vis [j])
{
Temp = low [j];
Pos = j;
}
If (pos =-1) return-1;
Vis [pos] = 1;
Ans + = low [pos];
For (int j = 1; j <= n; j ++)
If (! Vis [j] & low [j]> map [pos] [j])
Low [j] = map [pos] [j];
}
Return ans;
}
Int main ()
{
Int t;
Scanf ("% d", & t );
While (t --)
{
Scanf ("% d", & n );
Init ();
For (int I = 1; I <= n; I ++)
{
Scanf ("% lf", & a [I]. x, & a [I]. y );
}
For (int I = 1; I <= n; I ++)
For (int j = 1; j <= n; j ++)
{
If (I = j) map [I] [j] = 0;
Else
{
Double temp = dis (I, j );
If (temp> 1000 | temp <10)
Map [I] [j] = INF;
Else map [I] [j] = temp * 100;
}
}
Double res = prim ();
If (res =-1) puts ("oh! ");
Else printf ("%. 1lf \ n", res );
}
Return 0;