N,K=map(int, input().split()) D=[[-1]*(N+1) for i in range(N+1)] A=[(0,0)] for i in range(N): x,y=map(int, input().split()) A.append((x,y)) for i in range(N+1): for j in range(N+1): x=A[i][0]-A[j][0] y=A[i][1]-A[j][1] D[i][j]=(x**2+y**2)**.5 dp=[[[10**18]*(1<dp[c][now][bit]+D[now][i+1] and c>1: dp[c-1][i+1][bbit]=dp[c][now][bit]+D[now][i+1] d.append((i+1,bbit,c-1)) if dp[K][0][bbit]>dp[c][now][bit]+D[now][i+1]+D[i+1][0]: dp[K][0][bbit]=dp[c][now][bit]+D[now][i+1]+D[i+1][0] d.append((0,bbit,K)) print(dp[K][0][-1])