import queue
import math

INF = 1e9


class Node:
    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
     ans = 0
     for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
     return ans

def Prim(src):
    pq = queue.PriorityQueue()
    pq.put(Node(src, 0))
    dist[src] = 0
    while pq.empty() == False:
        top = pq.get()
        u = top.id
        d = top.dist
        visited[u] = True
        for neighbor in range(n):
            if visited[neighbor] == False and graph[u][neighbor] < dist[neighbor]:
                dist[neighbor] = graph[u][neighbor]
                pq.put(Node(neighbor, graph[u][neighbor]))
                path[neighbor] = u


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2)**2 + (y1 - y2)**2)


t = int(input())
blank = input()
for i in range(t):
    n = int(input())
    dist = [INF for i in range(n + 1)]
    path = [-1 for i in range(n + 1)]
    visited = [False for i in range(n + 1)]

    point = []
    for j in range(n):
        x, y = map(float, input().split())
        point.append((x, y))

    graph = []
    for j in range(n):
        graph.append([])
        for k in range(n):
            graph[j].append(distance(point[j][0], point[j][1], point[k][0], point[k][1]))

    Prim(0)
    res = printMST()
    print("%.2f" % res)
    if i != t - 1:
        blank = input()
        print()

4b788db5b6be8feeb12c38fcd579a0f0d8451a38
<mask token>


class Node:

    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
    ans = 0
    for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
    return ans


<mask token>


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)


<mask token>

<mask token>


class Node:

    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
    ans = 0
    for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
    return ans


def Prim(src):
    pq = queue.PriorityQueue()
    pq.put(Node(src, 0))
    dist[src] = 0
    while pq.empty() == False:
        top = pq.get()
        u = top.id
        d = top.dist
        visited[u] = True
        for neighbor in range(n):
            if visited[neighbor] == False and graph[u][neighbor] < dist[
                neighbor]:
                dist[neighbor] = graph[u][neighbor]
                pq.put(Node(neighbor, graph[u][neighbor]))
                path[neighbor] = u


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)


<mask token>

<mask token>
INF = 1000000000.0


class Node:

    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
    ans = 0
    for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
    return ans


def Prim(src):
    pq = queue.PriorityQueue()
    pq.put(Node(src, 0))
    dist[src] = 0
    while pq.empty() == False:
        top = pq.get()
        u = top.id
        d = top.dist
        visited[u] = True
        for neighbor in range(n):
            if visited[neighbor] == False and graph[u][neighbor] < dist[
                neighbor]:
                dist[neighbor] = graph[u][neighbor]
                pq.put(Node(neighbor, graph[u][neighbor]))
                path[neighbor] = u


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)


t = int(input())
blank = input()
for i in range(t):
    n = int(input())
    dist = [INF for i in range(n + 1)]
    path = [(-1) for i in range(n + 1)]
    visited = [(False) for i in range(n + 1)]
    point = []
    for j in range(n):
        x, y = map(float, input().split())
        point.append((x, y))
    graph = []
    for j in range(n):
        graph.append([])
        for k in range(n):
            graph[j].append(distance(point[j][0], point[j][1], point[k][0],
                point[k][1]))
    Prim(0)
    res = printMST()
    print('%.2f' % res)
    if i != t - 1:
        blank = input()
        print()

import queue
import math
INF = 1000000000.0


class Node:

    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
    ans = 0
    for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
    return ans


def Prim(src):
    pq = queue.PriorityQueue()
    pq.put(Node(src, 0))
    dist[src] = 0
    while pq.empty() == False:
        top = pq.get()
        u = top.id
        d = top.dist
        visited[u] = True
        for neighbor in range(n):
            if visited[neighbor] == False and graph[u][neighbor] < dist[
                neighbor]:
                dist[neighbor] = graph[u][neighbor]
                pq.put(Node(neighbor, graph[u][neighbor]))
                path[neighbor] = u


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)


t = int(input())
blank = input()
for i in range(t):
    n = int(input())
    dist = [INF for i in range(n + 1)]
    path = [(-1) for i in range(n + 1)]
    visited = [(False) for i in range(n + 1)]
    point = []
    for j in range(n):
        x, y = map(float, input().split())
        point.append((x, y))
    graph = []
    for j in range(n):
        graph.append([])
        for k in range(n):
            graph[j].append(distance(point[j][0], point[j][1], point[k][0],
                point[k][1]))
    Prim(0)
    res = printMST()
    print('%.2f' % res)
    if i != t - 1:
        blank = input()
        print()

import queue
import math

INF = 1e9


class Node:
    def __init__(self, id, dist):
        self.dist = dist
        self.id = id

    def __lt__(self, other):
        return self.dist <= other.dist


def printMST():
     ans = 0
     for i in range(n):
        if path[i] == -1:
            continue
        ans += dist[i]
     return ans

def Prim(src):
    pq = queue.PriorityQueue()
    pq.put(Node(src, 0))
    dist[src] = 0
    while pq.empty() == False:
        top = pq.get()
        u = top.id
        d = top.dist
        visited[u] = True
        for neighbor in range(n):
            if visited[neighbor] == False and graph[u][neighbor] < dist[neighbor]:
                dist[neighbor] = graph[u][neighbor]
                pq.put(Node(neighbor, graph[u][neighbor]))
                path[neighbor] = u


def distance(x1, y1, x2, y2):
    return math.sqrt((x1 - x2)**2 + (y1 - y2)**2)


t = int(input())
blank = input()
for i in range(t):
    n = int(input())
    dist = [INF for i in range(n + 1)]
    path = [-1 for i in range(n + 1)]
    visited = [False for i in range(n + 1)]

    point = []
    for j in range(n):
        x, y = map(float, input().split())
        point.append((x, y))

    graph = []
    for j in range(n):
        graph.append([])
        for k in range(n):
            graph[j].append(distance(point[j][0], point[j][1], point[k][0], point[k][1]))

    Prim(0)
    res = printMST()
    print("%.2f" % res)
    if i != t - 1:
        blank = input()
        print()
