import numpy as np

from math import sqrt,factorial

N = int(eval(input()))

M = [0]*N

edge = np.zeros([N,N])

sum=0

for i in range(N):

    M[i] = list(map(int,input().split()))

for i in range(N):

    for k in range(i+1,N):

        edge[i,k] = sqrt((M[i][0]-M[k][0])**2 + (M[i][1]-M[k][1])**2)

        sum+=edge[i,k]

average = sum/N*2

print(average)
N = int(eval(input()))

M = [0]*N

edge = [0]*N

for i in range(N):

  edge[i]=[0]*N

sum=0

for i in range(N):

    M[i] = list(map(int,input().split()))

for i in range(N):

    for k in range(i+1,N):

        edge[i][k] = pow(((M[i][0]-M[k][0])**2 + (M[i][1]-M[k][1])**2),0.5)

        sum+=edge[i][k]

average = sum/N*2

print(average)
import numpy as np
from math import sqrt, factorial

N = int(eval(input()))
M = [0] * N
edge = np.zeros([N, N])
sum = 0
for i in range(N):
    M[i] = list(map(int, input().split()))
for i in range(N):
    for k in range(i + 1, N):
        edge[i, k] = sqrt((M[i][0] - M[k][0]) ** 2 + (M[i][1] - M[k][1]) ** 2)
        sum += edge[i, k]
average = sum / N * 2
print(average)

N = int(eval(input()))
M = [0] * N
edge = [0] * N
for i in range(N):
    edge[i] = [0] * N
sum = 0
for i in range(N):
    M[i] = list(map(int, input().split()))
for i in range(N):
    for k in range(i + 1, N):
        edge[i][k] = pow(((M[i][0] - M[k][0]) ** 2 + (M[i][1] - M[k][1]) ** 2), 0.5)
        sum += edge[i][k]
average = sum / N * 2
print(average)

-import numpy as np -from math import sqrt, factorial - -edge = np.zeros([N, N]) +edge = [0] * N +for i in range(N): +    edge[i] = [0] * N -        edge[i, k] = sqrt((M[i][0] - M[k][0]) ** 2 + (M[i][1] - M[k][1]) ** 2) -        sum += edge[i, k] +        edge[i][k] = pow(((M[i][0] - M[k][0]) ** 2 + (M[i][1] - M[k][1]) ** 2), 0.5) +        sum += edge[i][k]