import sys

import itertools

import numpy as np



lines = sys.stdin.readlines()



N = int(lines[0].rstrip())

perms = list(itertools.permutations(list(range(N))))

combs = list(itertools.combinations(list(range(N)), 2))



arr_2d = np.zeros((N,2))

if N <= 2:

	arr_dist_memo = np.zeros((len(combs)+1,len(combs)+1))

else:

	arr_dist_memo = np.zeros((len(combs),len(combs)))



arr_dist_ave = np.zeros(len(perms))



for i, line in enumerate(lines[1:]):

    x, y = list(map(int,line.split(' ')))

    arr_2d[i, 0] = x

    arr_2d[i, 1] = y



for i,j in combs:

    arr_dist_memo[i, j] = np.linalg.norm(arr_2d[i] - arr_2d[j])



for index, l in enumerate(perms):

    for i, j  in zip(list(range(N-1)), list(range(1, N))):

        arr_dist_ave[index] += arr_dist_memo[l[i],l[j]]



print((np.mean(arr_dist_ave)*2))
n=int(eval(input()))

xy=[]

for _ in range(n):

	x,y=list(map(int,input().split()))

	xy.append([x,y])

ans=0

for i in range(n):

	for j in range(n):

		ans+=((xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2)**0.5

print((ans/n))

import sys
import itertools
import numpy as np

lines = sys.stdin.readlines()
N = int(lines[0].rstrip())
perms = list(itertools.permutations(list(range(N))))
combs = list(itertools.combinations(list(range(N)), 2))
arr_2d = np.zeros((N, 2))
if N <= 2:
    arr_dist_memo = np.zeros((len(combs) + 1, len(combs) + 1))
else:
    arr_dist_memo = np.zeros((len(combs), len(combs)))
arr_dist_ave = np.zeros(len(perms))
for i, line in enumerate(lines[1:]):
    x, y = list(map(int, line.split(" ")))
    arr_2d[i, 0] = x
    arr_2d[i, 1] = y
for i, j in combs:
    arr_dist_memo[i, j] = np.linalg.norm(arr_2d[i] - arr_2d[j])
for index, l in enumerate(perms):
    for i, j in zip(list(range(N - 1)), list(range(1, N))):
        arr_dist_ave[index] += arr_dist_memo[l[i], l[j]]
print((np.mean(arr_dist_ave) * 2))

n = int(eval(input()))
xy = []
for _ in range(n):
    x, y = list(map(int, input().split()))
    xy.append([x, y])
ans = 0
for i in range(n):
    for j in range(n):
        ans += ((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2) ** 0.5
print((ans / n))

-import sys -import itertools -import numpy as np - -lines = sys.stdin.readlines() -N = int(lines[0].rstrip()) -perms = list(itertools.permutations(list(range(N)))) -combs = list(itertools.combinations(list(range(N)), 2)) -arr_2d = np.zeros((N, 2)) -if N <= 2: -    arr_dist_memo = np.zeros((len(combs) + 1, len(combs) + 1)) -else: -    arr_dist_memo = np.zeros((len(combs), len(combs))) -arr_dist_ave = np.zeros(len(perms)) -for i, line in enumerate(lines[1:]): -    x, y = list(map(int, line.split(" "))) -    arr_2d[i, 0] = x -    arr_2d[i, 1] = y -for i, j in combs: -    arr_dist_memo[i, j] = np.linalg.norm(arr_2d[i] - arr_2d[j]) -for index, l in enumerate(perms): -    for i, j in zip(list(range(N - 1)), list(range(1, N))): -        arr_dist_ave[index] += arr_dist_memo[l[i], l[j]] -print((np.mean(arr_dist_ave) * 2)) +n = int(eval(input())) +xy = [] +for _ in range(n): +    x, y = list(map(int, input().split())) +    xy.append([x, y]) +ans = 0 +for i in range(n): +    for j in range(n): +        ans += ((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2) ** 0.5 +print((ans / n))