#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;

int main() {
    int N, K;
    cin >> N >> K;
    vector<double> X(N), Y(N);
    for (int i = 0; i < N; i++) cin >> X[i] >> Y[i];

    auto dist = [&](int i, int j) {
        if (i == N && j == N) return 0.0;
        if (j == N) return hypot(X[i], Y[i]);
        if (i == N) return hypot(X[j], Y[j]);
        return hypot(X[i] - X[j], Y[i] - Y[j]);
    };

    const double inf = 1e30;
    vector dp(vector(1 << N, vector(N + 1, vector<double>(K + 1, inf))));
    dp[0].back().back() = 0;
    for (int i = 0; i < 1 << N; i++) {
        for (int j = 0; j <= N; j++) {
            for (int k = 0; k <= K; k++) {
                if (dp[i][j][k] == inf) continue;
                if (j != N) {
                    dp[i][N][K] = min(dp[i][N][K], dp[i][j][k] + dist(j, N));
                }
                if (k > 0) {
                    for (int l = 0; l < N; l++) {
                        if (!(i >> l & 1)) {
                            dp[i | 1 << l][l][k - 1] = min(dp[i | 1 << l][l][k - 1], dp[i][j][k] + dist(j, l));
                        }
                    }
                }
            }
        }
    }

    printf("%.10f\n", dp.back().back().back());
}