fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val xy = 0.until(n).map {
        readLine()?.split(" ")?.map(String::toDouble) ?: return
    }

    fun dfs(routes: List<Int>, candidates: List<Int>, distances: MutableList<Double>) {
        if (candidates.isEmpty()) {
            // 計算する
            val distance = 0.until(n - 1).sumByDouble {
                val i = xy[routes[it]]
                val j = xy[routes[it + 1]]
                Math.sqrt(Math.pow(i[0] - j[0], 2.0) + Math.pow(i[1] - j[1], 2.0))
            }
            distances.add(distance)
        } else {
            candidates.forEach {
                dfs(
                    routes + it,
                    candidates - it,
                    distances
                )
            }
        }
    }

    val distances = mutableListOf<Double>()
    dfs(emptyList(), 0.until(n).toList(), distances)
    println(String.format("%.10f", distances.average()))
}
