program name
    integer(4):: n,i,cnt
    real(8),allocatable:: x(:), y(:)
    real(8):: ans

    read*, n
    allocate(x(n), y(n))
    do i=1,n
        read*, x(i), y(i)
    end do
    ans=0d0
    cnt=0
    do i=1,n
        do j=1,n
            if (i==j) cycle
            ans=ans+dst(i,j)
            cnt=cnt+1
        end do
    end do
    print*, ans/cnt*dble(n-1)

contains
function dst(a,b) result(ret)
    integer(4):: a,b
    real(8):: ret

    ret = sqrt((x(a)-x(b))**2+(y(a)-y(b))**2)
end function
end program name