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 cc=(N+1)*(N+1) dp=[[10**20]*(1<dp[cc][bit]+D[now][i+1] and c>1: dp[cp][bbit]=dp[cc][bit]+D[now][i+1] d.append((cp,bbit)) cp=K*(N+1) if dp[cp][bbit]>dp[cc][bit]+D[now][i+1]+D[i+1][0]: dp[cp][bbit]=dp[cc][bit]+D[now][i+1]+D[i+1][0] d.append((cp,bbit)) print(dp[K*(N+1)][-1])