#include using namespace std; using i64 = long long; const int N = 14; int n, k, x[N], y[N]; double dis[1 << N][N], d[1 << N], dp[1 << N]; int t1(int x) { return x ? t1(x >> 1) + 1 : -1; } int ppc(int x) { return x ? ppc(x - (x & -x)) + 1 : 0; } double f(int x, int y) { return sqrt(x * (i64)x + y * (i64)y); } double f(int i) { return f(x[i], y[i]); } int main() { int n, k; cin >> n >> k; for(int i = 0; i < n; i ++) cin >> x[i] >> y[i]; for(int i = 1; i < (1 << n); i ++) { fill(dis[i], dis[i] + n, 1e15); if(i == (i & -i)) dis[i][t1(i)] = 2 * f(t1(i)); else{ for(int j = 0; j < n; j ++) { if(!((i >> j) & 1)) continue; for(int p = i ^ (1 << j), k = 0; k < n; k ++) { if((p >> k) & 1) dis[i][j] = min(dis[i][j], dis[p][k] - f(k) + f(j) + f(x[j] - x[k], y[j] - y[k])); } } } d[i] = *min_element(dis[i], dis[i] + n); if(ppc(i) > k) d[i] = 1e15; dp[i] = d[i]; for(int j = i; j; j = (j - 1) & i) dp[i] = min(dp[i], dp[j] + d[i ^ j]); } cout << fixed << setprecision(7) << dp[(1 << n) - 1] << "\n"; }