problem
solution
codes
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
typedef double LD;
const int maxn = 55;
int n, vis[maxn];
LD a[maxn], b[maxn], dis[maxn][maxn], now, ans=(int)1e9;
void dfs(int c, int p){
if(now>ans)return ;
if(c==n){ ans = min(ans,now); return ;}
vis[p] = 1;
for(int i = 1; i <= n; i++){
if(!vis[i]){
now += dis[p][i];
dfs(c+1,i);
now -= dis[p][i];
}
}
vis[p] = 0;
}
int main(){
ios::sync_with_stdio(false);
cin>>n;
for(int i = 1; i <= n; i++)
cin>>a[i]>>b[i];
for(int i = 0; i <= n; i++)
for(int j = 0; j <= n; j++)
dis[i][j] = sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
dfs(0,0);
printf("%.2lf
",ans);
return 0;
}