program prob3
    implicit none
    real(8)::tmp
    integer::n, i, j
    integer, allocatable::x(:,:)
    read*, n
    tmp = dble(0)
    allocate(x(n,2))
    do i = 1, n
        read(*,*) x(i,1), x(i,2)
    end do
    do i = 2, n
        do j = 1, i-1
            tmp = tmp + sqrt(dble(x(i,1) - x(j,1))**2 + dble(x(i,2) - x(j,2))**2)
        end do
    end do
    tmp = tmp * dble(2) / dble(n)
    write(*,*) tmp
    stop
end program