#include <cstdio> #include <iostream> #include <algorithm> #include <cmath> using namespace std; const int N=5010; const int INF=1<<30; int n,x[N],y[N],vis[N]; double ans,d[N]; double dist(int a,int b){ double dx=abs(x[a]-x[b]),dy=abs(y[a]-y[b]); return sqrt(dx*dx+dy*dy); } int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d%d",&x[i],&y[i]); for(int i=2;i<=n;i++)d[i]=dist(1,i); vis[1]=1; for(int i=2;i<=n;i++){ int v=-1; double minn=INF; for(int j=1;j<=n;j++) if(!vis[j] && d[j]<minn){ minn=d[j]; v=j; } vis[v]=1; ans+=minn; for(int j=1;j<=n;j++) if(!vis[j]){ double d1=dist(v,j); d[j]=min(d[j],d1); } } printf("%.2lf ",ans); return 0; }