# coding UTF-8

# 

# problem C

# 

import itertools

import numpy as np

from scipy.spatial import distance



N = int(eval(input()))

city = []

for i in range(N):

    city.append(list(map(int, input().split())))



d = distance.cdist(city, city, metric='euclidean')



ans = []

city_no = list(range(N))

for elem in itertools.permutations(city_no, N):

    for j in range(len(elem)-1):

        ans.append(d[elem[j], elem[j+1]])



print(((sum(ans)/len(ans))*(N-1)))

import sys

import math

import itertools



readline = sys.stdin.readline

sqrt = math.sqrt



def euclid_distance(a, b):

    return sqrt(pow(a[0]-b[0],2) + pow(a[1]-b[1],2))



def main():

    N = int(eval(input()))

    A = []

    for _ in range(N):

        A.append(tuple(map(int, readline().split())))

    

    D = []

    for i in range(N):

        tmp = []

        for j in range(N):

            tmp.append(euclid_distance(A[i], A[j]))

        D.append(tmp)



    distance = []

    for root in itertools.permutations(list(range(N))):

        dsum = 0

        for r in range(N-1):

            dsum += D[root[r]][root[r+1]]

        distance.append(dsum)

    

    ans = sum(distance)/len(distance)    

    print(ans)





if __name__ == "__main__":

    main()

# coding UTF-8
#
# problem C
#
import itertools
import numpy as np
from scipy.spatial import distance

N = int(eval(input()))
city = []
for i in range(N):
    city.append(list(map(int, input().split())))
d = distance.cdist(city, city, metric="euclidean")
ans = []
city_no = list(range(N))
for elem in itertools.permutations(city_no, N):
    for j in range(len(elem) - 1):
        ans.append(d[elem[j], elem[j + 1]])
print(((sum(ans) / len(ans)) * (N - 1)))

import sys
import math
import itertools

readline = sys.stdin.readline
sqrt = math.sqrt


def euclid_distance(a, b):
    return sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2))


def main():
    N = int(eval(input()))
    A = []
    for _ in range(N):
        A.append(tuple(map(int, readline().split())))
    D = []
    for i in range(N):
        tmp = []
        for j in range(N):
            tmp.append(euclid_distance(A[i], A[j]))
        D.append(tmp)
    distance = []
    for root in itertools.permutations(list(range(N))):
        dsum = 0
        for r in range(N - 1):
            dsum += D[root[r]][root[r + 1]]
        distance.append(dsum)
    ans = sum(distance) / len(distance)
    print(ans)


if __name__ == "__main__":
    main()

-# coding UTF-8 -# -# problem C -# +import sys +import math -import numpy as np -from scipy.spatial import distance -N = int(eval(input())) -city = [] -for i in range(N): -    city.append(list(map(int, input().split()))) -d = distance.cdist(city, city, metric="euclidean") -ans = [] -city_no = list(range(N)) -for elem in itertools.permutations(city_no, N): -    for j in range(len(elem) - 1): -        ans.append(d[elem[j], elem[j + 1]]) -print(((sum(ans) / len(ans)) * (N - 1))) +readline = sys.stdin.readline +sqrt = math.sqrt + + +def euclid_distance(a, b): +    return sqrt(pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2)) + + +def main(): +    N = int(eval(input())) +    A = [] +    for _ in range(N): +        A.append(tuple(map(int, readline().split()))) +    D = [] +    for i in range(N): +        tmp = [] +        for j in range(N): +            tmp.append(euclid_distance(A[i], A[j])) +        D.append(tmp) +    distance = [] +    for root in itertools.permutations(list(range(N))): +        dsum = 0 +        for r in range(N - 1): +            dsum += D[root[r]][root[r + 1]] +        distance.append(dsum) +    ans = sum(distance) / len(distance) +    print(ans) + + +if __name__ == "__main__": +    main()