N,K=list(map(int,input().split())) M=[] def dist(i,j): return ((M[i][0]-M[j][0])**2+(M[i][1]-M[j][1])**2)**(0.5) for i in range(N): x,y=list(map(int,input().split())) M.append((x,y)) M.append((0,0)) dp=[] for i in range(N+1): p=[] for k in range(K+1): p.append([10**18]*(2**N)) dp.append(p) dp[N][K][0]=0#dp[どこにいるかNならピザや][何枚あるか][どこ尋ねたか] for i in range(2**N): for j in range(N+1): for k in range(K+1): if dp[j][k][i]>10**15: continue if j!=N: if k==0: dp[N][K][i]=min(dp[N][K][i],dp[j][k][i]+dist(j,N)) else: dp[N][K][i]=min(dp[N][K][i],dp[j][k][i]+dist(j,N)) for l in range(N): if 2**j&i!=0 and 2**l&i==0: dp[l][k-1][i|2**l]=min(dp[l][k-1][i|2**l],dp[j][k][i]+dist(j,l)) else: for l in range(N): if 2**l&i==0: dp[l][k-1][i|2**l]=min(dp[l][k-1][i|2**l],dp[j][k][i]+dist(j,l)) print(dp[N][K][2**N-1])