#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector> a(n); for(auto &&[x, y] : a) cin >> x >> y; vector dp(1 << n, 1ll << 60); array tmp; tmp.fill(1ll << 60); vector> dp2(1 << n, tmp); auto calc = [&](int x1, int y1, int x2, int y2){ ll dx = x2 - x1, dy = y2 - y1; return sqrt(dx * dx + dy * dy); }; array,15> T; for(int i = 0; i < n; i++){ auto [x1, y1] = a[i]; T[i][14] = T[14][i] = calc(0, 0, x1, y1); for(int j = i + 1; j < n; j++){ auto [x2, y2] = a[j]; T[i][j] = T[j][i] = calc(x1, y1, x2, y2); } } for(int i = 0; i < n; i++){ dp2[1 << i][i] = T[i][14]; } for(int S = 1; S < (1 << n); S++){ int popcnt = __builtin_popcount(S); if(popcnt <= k){ double mn = 1ll << 60; for(int i = 0; i < n; i++){ if(~S >> i & 1) continue; mn = min(mn, dp2[S][i] + T[i][14]); if(popcnt < k){ for(int j = 0; j < n; j++){ if(S >> j & 1) continue; dp2[S | (1 << j)][j] = min(dp2[S | (1 << j)][j], dp2[S][i] + T[i][j]); } } } dp[S] = mn; }else{ for(int T = (S - 1) & S; T > 0; T = (T - 1) & S){ dp[S] = min(dp[S], dp[T] + dp[S ^ T]); } } } cout << fixed << setprecision(15) << dp.back() << '\n'; }