#include using namespace std; const int MAXN = 20, MAXX = (1 << 15); int k, n; double ans = 1e18, dp[MAXN][MAXN][MAXX]; struct E{ int x, y; } a[MAXN]; double C(int x, int y, int _x, int _y){ return sqrt(1ll * (x - _x) * (x - _x) + 1ll * (y - _y) * (y - _y)); } int main(){ cin >> n >> k; a[0] = {0, 0}; for(int i = 1; i <= n; i++){ cin >> a[i].x >> a[i].y; } for(int i = 0; i <= n; i++){ for(int j = 0; j <= k; j++){ for(int k = 0; k < (1 << (n + 1)); k++){ dp[i][j][k] = 1e18; } } } dp[0][k][1] = 0; for(int j = 1; j < (1 << (n + 1)); j++){ for(int i = 1; i <= n; i++){ if((j >> i & 1)) continue; for(int kk = 0; kk <= n; kk++){ if(!(j >> kk & 1)) continue; for(int sy = 0; sy <= k; sy++){ if(!sy){ dp[i][k - 1][j | (1 << i)] = min(dp[i][k - 1][j | (1 << i)], dp[kk][sy][j] + C(a[i].x, a[i].y, 0, 0) + C(0, 0, a[kk].x, a[kk].y)); } else { dp[i][sy - 1][j | (1 << i)] = min(dp[i][sy - 1][j | (1 << i)], dp[kk][sy][j] + C(a[i].x, a[i].y, a[kk].x, a[kk].y)); dp[i][k][j | (1 << i)] = min(dp[i][k][j | (1 << i)], dp[kk][sy][j] + C(a[i].x, a[i].y, a[kk].x, a[kk].y) + C(0, 0, a[i].x, a[i].y)); } } } } } for(int j = 1; j <= n; j++){ for(int i = 0; i <= k; i++){ ans = min(ans, dp[j][i][(1 << (n + 1)) - 1] + C(0, 0, a[j].x, a[j].y)); } } cout << fixed << setprecision(11) << ans; return 0; }