import itertools

import math

n=int(eval(input()))

empty_list=[]

a=[i for i in range(n)]

permutations_list=[list(b) for b in itertools.permutations(a)]

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

for i in range(math.factorial(n)):

  for j in range(n-1):

    empty_list.append(math.sqrt((coordinate_list[(permutations_list[i][j]-1)][0]-coordinate_list[(permutations_list[i][j+1]-1)][0])**2+(coordinate_list[(permutations_list[i][j]-1)][1]-coordinate_list[(permutations_list[i][j+1]-1)][1])**2))

b=int(math.factorial(n))

c=sum(empty_list)

print((c*(n-1)/((n-1)*b)))
from itertools import permutations

from math import sqrt,factorial

n=int(eval(input()))

ans=0

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

town=[]

for i in range(n):

    town.append(i)

for a in list(permutations(town)):

    for j in range(n-1):

        ans+=sqrt((distance[a[j+1]][1]-distance[a[j]][1])**2+(distance[a[j+1]][0]-distance[a[j]][0])**2)

print((ans/(factorial(n))))
import itertools
import math

n = int(eval(input()))
empty_list = []
a = [i for i in range(n)]
permutations_list = [list(b) for b in itertools.permutations(a)]
coordinate_list = [list(map(int, input().split())) for _ in range(n)]
for i in range(math.factorial(n)):
    for j in range(n - 1):
        empty_list.append(
            math.sqrt(
                (
                    coordinate_list[(permutations_list[i][j] - 1)][0]
                    - coordinate_list[(permutations_list[i][j + 1] - 1)][0]
                )
                ** 2
                + (
                    coordinate_list[(permutations_list[i][j] - 1)][1]
                    - coordinate_list[(permutations_list[i][j + 1] - 1)][1]
                )
                ** 2
            )
        )
b = int(math.factorial(n))
c = sum(empty_list)
print((c * (n - 1) / ((n - 1) * b)))

from itertools import permutations
from math import sqrt, factorial

n = int(eval(input()))
ans = 0
distance = [list(map(int, input().split())) for i in range(n)]
town = []
for i in range(n):
    town.append(i)
for a in list(permutations(town)):
    for j in range(n - 1):
        ans += sqrt(
            (distance[a[j + 1]][1] - distance[a[j]][1]) ** 2
            + (distance[a[j + 1]][0] - distance[a[j]][0]) ** 2
        )
print((ans / (factorial(n))))

-import itertools -import math +from itertools import permutations +from math import sqrt, factorial -empty_list = [] -a = [i for i in range(n)] -permutations_list = [list(b) for b in itertools.permutations(a)] -coordinate_list = [list(map(int, input().split())) for _ in range(n)] -for i in range(math.factorial(n)): +ans = 0 +distance = [list(map(int, input().split())) for i in range(n)] +town = [] +for i in range(n): +    town.append(i) +for a in list(permutations(town)): -        empty_list.append( -            math.sqrt( -                ( -                    coordinate_list[(permutations_list[i][j] - 1)][0] -                    - coordinate_list[(permutations_list[i][j + 1] - 1)][0] -                ) -                ** 2 -                + ( -                    coordinate_list[(permutations_list[i][j] - 1)][1] -                    - coordinate_list[(permutations_list[i][j + 1] - 1)][1] -                ) -                ** 2 -            ) +        ans += sqrt( +            (distance[a[j + 1]][1] - distance[a[j]][1]) ** 2 +            + (distance[a[j + 1]][0] - distance[a[j]][0]) ** 2 -b = int(math.factorial(n)) -c = sum(empty_list) -print((c * (n - 1) / ((n - 1) * b))) +print((ans / (factorial(n))))