#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <sstream>
#include <string>
#include <utility>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
// #include <array>

using namespace std;

class MSTree
{
public:
  int solve();
};

int MSTree::solve()
{
  int n;
  cin >> n;
  
  vector<vector<int>> adj(n, vector<int>(n));
  list<int> t, vt;

  for ( auto i = 0; i < n; ++i )
    for ( auto j = 0; j < n; ++j )
      cin >> adj[i][j];

  t.push_back( 0 );

  for ( auto i = 1; i < n; ++i )
    vt.push_back( i );

  int w = 0;

  while ( vt.size() )
    {
      int mw = 4000;
      list<int>::iterator itm;
      
      for ( auto ita = t.begin(); ita != t.end(); ++ita )
        for ( auto itb = vt.begin(); itb != vt.end(); ++itb )
          {
            if ( adj[*ita][*itb] >= 0 && mw > adj[*ita][*itb] )
              {
                itm = itb;
                mw = adj[*ita][*itb];
              }
          }
      
      w += mw;
      t.push_back( *itm );
      vt.erase( itm );
    }

  cout << w << endl;
    
  return 0;
}

int main()
{
  MSTree m;

  m.solve();

  return 0;
}
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
#include <stdio.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;
ll MODP = 998244353;

ll per(ll a){
  ll res = 1;
  for(int i = 1;i <= a;i++){
    res *= i;
  }
  return res;
}

int main(){
  ll N;
  cin >> N;
  vector<long double> x(N),y(N);
  rep(i,N)cin >> x[i] >> y[i];
  vector<vector<int>> kumi;
  vector<int> v;
  for(int i = 1;i <= N;i++)v.push_back(i);
  do{
    kumi.push_back(v);
  }while(next_permutation(v.begin(), v.end()));
  long double ans = 0;
  for(auto a : kumi){
    rep(i,a.size()-1){
      long double t = (x[a[i]-1]-x[a[i+1]-1])*(x[a[i]-1]-x[a[i+1]-1]);
      t += (y[a[i]-1]-y[a[i+1]-1])*(y[a[i]-1]-y[a[i+1]-1]);
      ans += sqrt(t);
    }
  }
  long double all = kumi.size();
  ans /= all;
  cout << fixed << setprecision(8) << ans << endl;

  return 0;
}
