#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
  int n, c;
  cin >> n >> c;
  ++n;
  vector<int> x(n), y(n);
  for (int i = 1; i < n; ++i) cin >> x[i] >> y[i];
  vector<vector<vector<double>>> dp(1 << n, vector<vector<double>> (n, vector<double> (c + 1, 1e300)));
  dp[1][0][c] = 0;
  for (int i = 0; i < 1 << n; ++i)
  {
    for (int k = 0; k <= c; ++k) dp[i][0][c] = min(dp[i][0][k], dp[i][0][c]);
    for (int j = 0; j < n; ++j)
    {
      if (!(i & (1 << j))) continue;
      for (int k = c; k > 0; --k)
      {
        for (int l = 0; l < n; ++l)
        {
          int id = (i | (1 << l));
          dp[id][l][k - 1] = min(dp[id][l][k - 1], dp[i][j][k] + hypot(x[l] - x[j], y[l] - y[j]));
        }
      }
      for (int k = 0; k <= c; ++k) dp[i | 1][0][c] = min(dp[i | 1][j][k] + hypot(x[j] - x[0], y[j] - y[0]), dp[i | 1][0][c]);
    }
  }
  double ans = dp[(1 << n) -1][0][c];
  printf("%.10f\n", ans);
}