N, K = map(int, input().split()) X, Y = [0] * (N + 1), [0] * (N + 1) for i in range(N): X[i + 1], Y[i + 1] = map(int, input().split()) N += 1 N2 = 1 << N inf = 1e18 dp = [[[inf] * (K + 1) for _ in range(N)] for _ in range(N2)] dp[1][0][K] = 0 def f(x1, y1, x2, y2): return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 for s in range(N2): for i in range(N): if (s >> i) & 1 == 0: continue for k in range(K + 1): if dp[s][i][k] > inf/2: continue dp[s][0][K] = min(dp[s][0][K], dp[s][i][k] + f(X[0], Y[0], X[i], Y[i])) for i in range(N): if (s >> i) & 1 == 0: continue for k in range(K + 1): if dp[s][i][k] > inf/2: continue if k == 0: continue for j in range(N): if (s >> j) & 1: continue ns = s | (1 << j) dp[ns][j][k - 1] = min(dp[ns][j][k - 1], dp[s][i][k] + f(X[i], Y[i], X[j], Y[j])) print(dp[-1][0][K])