import itertools

import math



n = int(eval(input()))



li = []

for i in range(n):

    a = list(map(int, input().split()))

    li.append(a)



p_list = list(itertools.permutations(li, n))



def cal_distance(lis):

    dis = 0

    for i in range(n-1):

        dis += math.sqrt((lis[i+1][0]-lis[i][0])**2 + (lis[i+1][1] - lis[i][1])**2)

    return dis



total_distance = 0

for i in range(len(p_list)):

    total_distance += cal_distance(p_list[i])



print((total_distance/len(p_list)))
from itertools import combinations

import math



n = int(eval(input()))



towns = []



for _ in range(n):

    array = list(map(int, input().split()))

    towns.append(array)





distances = [[0 for _ in range(n)] for _ in range(n)]



town_num = list(range(n))



for i, j in combinations(town_num, 2):

    distance = ((towns[j][0] - towns[i][0])**2 + (towns[j][1] - towns[i][1])**2)**(0.5)

    distances[i][j] = distance

    distances[j][i] = distance



total_way = math.factorial(n)



total = 0



for i in range(n):

    for j in range(n):

        total += distances[i][j] * math.factorial(n-1)



print((total/total_way))
import itertools
import math

n = int(eval(input()))
li = []
for i in range(n):
    a = list(map(int, input().split()))
    li.append(a)
p_list = list(itertools.permutations(li, n))


def cal_distance(lis):
    dis = 0
    for i in range(n - 1):
        dis += math.sqrt(
            (lis[i + 1][0] - lis[i][0]) ** 2 + (lis[i + 1][1] - lis[i][1]) ** 2
        )
    return dis


total_distance = 0
for i in range(len(p_list)):
    total_distance += cal_distance(p_list[i])
print((total_distance / len(p_list)))

from itertools import combinations
import math

n = int(eval(input()))
towns = []
for _ in range(n):
    array = list(map(int, input().split()))
    towns.append(array)
distances = [[0 for _ in range(n)] for _ in range(n)]
town_num = list(range(n))
for i, j in combinations(town_num, 2):
    distance = (
        (towns[j][0] - towns[i][0]) ** 2 + (towns[j][1] - towns[i][1]) ** 2
    ) ** (0.5)
    distances[i][j] = distance
    distances[j][i] = distance
total_way = math.factorial(n)
total = 0
for i in range(n):
    for j in range(n):
        total += distances[i][j] * math.factorial(n - 1)
print((total / total_way))

-import itertools +from itertools import combinations -li = [] +towns = [] +for _ in range(n): +    array = list(map(int, input().split())) +    towns.append(array) +distances = [[0 for _ in range(n)] for _ in range(n)] +town_num = list(range(n)) +for i, j in combinations(town_num, 2): +    distance = ( +        (towns[j][0] - towns[i][0]) ** 2 + (towns[j][1] - towns[i][1]) ** 2 +    ) ** (0.5) +    distances[i][j] = distance +    distances[j][i] = distance +total_way = math.factorial(n) +total = 0 -    a = list(map(int, input().split())) -    li.append(a) -p_list = list(itertools.permutations(li, n)) - - -def cal_distance(lis): -    dis = 0 -    for i in range(n - 1): -        dis += math.sqrt( -            (lis[i + 1][0] - lis[i][0]) ** 2 + (lis[i + 1][1] - lis[i][1]) ** 2 -        ) -    return dis - - -total_distance = 0 -for i in range(len(p_list)): -    total_distance += cal_distance(p_list[i]) -print((total_distance / len(p_list))) +    for j in range(n): +        total += distances[i][j] * math.factorial(n - 1) +print((total / total_way))