from itertools import permutations

from math import sqrt, fsum

N = int(eval(input()))

towns = [tuple(map(int, input().split())) for _ in range(N)]



ds = []

n = 0

for rt in permutations(towns, N):

    for i in range(1, N):

        x1, y1 = rt[i-1]

        x2, y2 = rt[i]

        d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)

        ds.append(d)

    n += 1

ans = fsum(ds) / n

print(ans)
import math

N = int(eval(input()))

P = [tuple(map(int, input().split())) for _ in range(N)]

DONE = (1 << N) - 1



ds = []

todo = [(0, i, (1 << i)) for i in range(N)]

while todo:

    d, i, state = todo.pop()

    x, y = P[i]

    for ni in range(N):

        if state & (1 << ni):

            continue

        nx, ny = P[ni]

        nd = d + math.sqrt((x - nx) ** 2 + (y - ny) ** 2)

        nstate = state | (1 << ni)

        if nstate == DONE:

            ds.append(nd)

        else:

            todo.append((nd, ni, nstate))

ans = math.fsum(ds) / len(ds)

print(ans)
from itertools import permutations
from math import sqrt, fsum

N = int(eval(input()))
towns = [tuple(map(int, input().split())) for _ in range(N)]
ds = []
n = 0
for rt in permutations(towns, N):
    for i in range(1, N):
        x1, y1 = rt[i - 1]
        x2, y2 = rt[i]
        d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
        ds.append(d)
    n += 1
ans = fsum(ds) / n
print(ans)

import math

N = int(eval(input()))
P = [tuple(map(int, input().split())) for _ in range(N)]
DONE = (1 << N) - 1
ds = []
todo = [(0, i, (1 << i)) for i in range(N)]
while todo:
    d, i, state = todo.pop()
    x, y = P[i]
    for ni in range(N):
        if state & (1 << ni):
            continue
        nx, ny = P[ni]
        nd = d + math.sqrt((x - nx) ** 2 + (y - ny) ** 2)
        nstate = state | (1 << ni)
        if nstate == DONE:
            ds.append(nd)
        else:
            todo.append((nd, ni, nstate))
ans = math.fsum(ds) / len(ds)
print(ans)

-from itertools import permutations -from math import sqrt, fsum +import math -towns = [tuple(map(int, input().split())) for _ in range(N)] +P = [tuple(map(int, input().split())) for _ in range(N)] +DONE = (1 << N) - 1 -n = 0 -for rt in permutations(towns, N): -    for i in range(1, N): -        x1, y1 = rt[i - 1] -        x2, y2 = rt[i] -        d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) -        ds.append(d) -    n += 1 -ans = fsum(ds) / n +todo = [(0, i, (1 << i)) for i in range(N)] +while todo: +    d, i, state = todo.pop() +    x, y = P[i] +    for ni in range(N): +        if state & (1 << ni): +            continue +        nx, ny = P[ni] +        nd = d + math.sqrt((x - nx) ** 2 + (y - ny) ** 2) +        nstate = state | (1 << ni) +        if nstate == DONE: +            ds.append(nd) +        else: +            todo.append((nd, ni, nstate)) +ans = math.fsum(ds) / len(ds)