from math import factorial

from itertools import permutations

def main():

    n = int(eval(input()))

    town_coor = []

    for _ in range(n):

        town_coor.append(tuple(map(int, input().split())))



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

    roads = permutations(towns, n)

    sum_roads = 0

    for road in roads:

        sum_road = 0

        for i1 in range(n-1):

            sum_road += ((town_coor[road[i1]][0] - town_coor[road[i1 +1]][0])**2 + (town_coor[road[i1]][1] - town_coor[road[i1 +1]][1])**2)**0.5

        sum_roads += sum_road

    print((sum_roads / factorial(n)))



if __name__ == '__main__':

    main()

from math import factorial

from itertools import permutations

def main():

    n = int(eval(input()))

    town_coor = []

    for _ in range(n):

        town_coor.append(tuple(map(int, input().split())))



    dists = [[0]*n for _ in range(n)]

    for j1 in range(n):

        for j2 in range(n):

            dists[j1][j2] = ((town_coor[j1][0] - town_coor[j2][0])**2 + (town_coor[j1][1] - town_coor[j2][1])**2)**0.5





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

    roads = permutations(towns, n)

    sum_roads = 0

    for road in roads:

        sum_road = 0

        for i1 in range(n-1):

            sum_road += dists[road[i1]][road[i1+1]]

        sum_roads += sum_road

    print((sum_roads / factorial(n)))



if __name__ == '__main__':

    main()

from math import factorial
from itertools import permutations


def main():
    n = int(eval(input()))
    town_coor = []
    for _ in range(n):
        town_coor.append(tuple(map(int, input().split())))
    towns = [i for i in range(n)]
    roads = permutations(towns, n)
    sum_roads = 0
    for road in roads:
        sum_road = 0
        for i1 in range(n - 1):
            sum_road += (
                (town_coor[road[i1]][0] - town_coor[road[i1 + 1]][0]) ** 2
                + (town_coor[road[i1]][1] - town_coor[road[i1 + 1]][1]) ** 2
            ) ** 0.5
        sum_roads += sum_road
    print((sum_roads / factorial(n)))


if __name__ == "__main__":
    main()

from math import factorial
from itertools import permutations


def main():
    n = int(eval(input()))
    town_coor = []
    for _ in range(n):
        town_coor.append(tuple(map(int, input().split())))
    dists = [[0] * n for _ in range(n)]
    for j1 in range(n):
        for j2 in range(n):
            dists[j1][j2] = (
                (town_coor[j1][0] - town_coor[j2][0]) ** 2
                + (town_coor[j1][1] - town_coor[j2][1]) ** 2
            ) ** 0.5
    towns = [i for i in range(n)]
    roads = permutations(towns, n)
    sum_roads = 0
    for road in roads:
        sum_road = 0
        for i1 in range(n - 1):
            sum_road += dists[road[i1]][road[i1 + 1]]
        sum_roads += sum_road
    print((sum_roads / factorial(n)))


if __name__ == "__main__":
    main()

+    dists = [[0] * n for _ in range(n)] +    for j1 in range(n): +        for j2 in range(n): +            dists[j1][j2] = ( +                (town_coor[j1][0] - town_coor[j2][0]) ** 2 +                + (town_coor[j1][1] - town_coor[j2][1]) ** 2 +            ) ** 0.5 -            sum_road += ( -                (town_coor[road[i1]][0] - town_coor[road[i1 + 1]][0]) ** 2 -                + (town_coor[road[i1]][1] - town_coor[road[i1 + 1]][1]) ** 2 -            ) ** 0.5 +            sum_road += dists[road[i1]][road[i1 + 1]]