module Main
  ( main
  )
where

import           Control.Applicative
import           Control.Monad
import           Data.List
import           Data.Array
import           Data.Char
import           Data.Bits

main = do
  n      <- (read :: String -> Int) <$> getLine
  coords <- listArray (0, n - 1) <$> forM
    [1 .. n]
    (\i -> (\[a, b] -> (a, b)) . map (read :: String -> Int) . words <$> getLine
    )
  let allOrders    = countPermutation [] 0 n
      allDistances = map (calcDistance coords) allOrders
      meanDistance =
        sum allDistances / (fromIntegral (length allDistances) :: Double)
  print meanDistance

countPermutation :: [Int] -> Int -> Int -> [[Int]]
countPermutation order used n
  | used /= shift 1 n - 1 = do
    next <- extractUnused used n
    countPermutation (next : order) (used .|. shift 1 next) n
  | otherwise = return order

extractUnused :: Int -> Int -> [Int]
extractUnused a b = filter (\x -> (shift a (-x) .&. 1) == 0) [0 .. (b - 1)]

calcDistance :: Array Int (Int, Int) -> [Int] -> Double
calcDistance arr (a : b : rest) =
  let (x1, y1) = arr ! a
      (x2, y2) = arr ! b
      xDiff    = (x1 - x2) ^ 2
      yDiff    = (y1 - y2) ^ 2
  in  sqrt (fromIntegral (xDiff + yDiff) :: Double)
        + calcDistance arr (b : rest)
calcDistance arr [a] = 0.0
