import itertools



n = int(eval(input()))



route = [list(map(int, input().split())) for _ in range(n)]

results = []

for v in itertools.permutations(route, r=n):

    distance = 0

    for i in range(n - 1):

        start, goal = v[i], v[i + 1]

        distance += ((goal[0] - start[0]) ** 2 + (goal[1] - start[1]) ** 2) ** 0.5

    results.append(distance)

print((sum(results) / len(results)))

n = int(eval(input()))

xy = [list(map(int, input().split())) for _ in range(n)]



def distance(i1, i2):

    p1 = xy[i1]

    p2 = xy[i2]

    return ((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) ** 0.5



dp = [None] * (1 << n)

def dfs(state=0):

    if dp[state] is not None:

        return dp[state]



    ans = []

    s = 0

    for i in range(n):

        target = 1 << i

        if not state & target:

            res = dfs(state | target)

            ans.append(i)

            for v in res[0]:

                s += distance(i, v)

    dp[state] = ans, s

    return dp[state]



print((dfs()[1] / n))

import itertools

n = int(eval(input()))
route = [list(map(int, input().split())) for _ in range(n)]
results = []
for v in itertools.permutations(route, r=n):
    distance = 0
    for i in range(n - 1):
        start, goal = v[i], v[i + 1]
        distance += ((goal[0] - start[0]) ** 2 + (goal[1] - start[1]) ** 2) ** 0.5
    results.append(distance)
print((sum(results) / len(results)))

n = int(eval(input()))
xy = [list(map(int, input().split())) for _ in range(n)]


def distance(i1, i2):
    p1 = xy[i1]
    p2 = xy[i2]
    return ((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) ** 0.5


dp = [None] * (1 << n)


def dfs(state=0):
    if dp[state] is not None:
        return dp[state]
    ans = []
    s = 0
    for i in range(n):
        target = 1 << i
        if not state & target:
            res = dfs(state | target)
            ans.append(i)
            for v in res[0]:
                s += distance(i, v)
    dp[state] = ans, s
    return dp[state]


print((dfs()[1] / n))

-import itertools +n = int(eval(input())) +xy = [list(map(int, input().split())) for _ in range(n)] -n = int(eval(input())) -route = [list(map(int, input().split())) for _ in range(n)] -results = [] -for v in itertools.permutations(route, r=n): -    distance = 0 -    for i in range(n - 1): -        start, goal = v[i], v[i + 1] -        distance += ((goal[0] - start[0]) ** 2 + (goal[1] - start[1]) ** 2) ** 0.5 -    results.append(distance) -print((sum(results) / len(results))) + +def distance(i1, i2): +    p1 = xy[i1] +    p2 = xy[i2] +    return ((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) ** 0.5 + + +dp = [None] * (1 << n) + + +def dfs(state=0): +    if dp[state] is not None: +        return dp[state] +    ans = [] +    s = 0 +    for i in range(n): +        target = 1 << i +        if not state & target: +            res = dfs(state | target) +            ans.append(i) +            for v in res[0]: +                s += distance(i, v) +    dp[state] = ans, s +    return dp[state] + + +print((dfs()[1] / n))