R=range J=lambda:map(int,input().split()) N,K=J() v=[list(J())for i in R(N)]+[[0,0]] M=N+1 w=[[0]*M for i in R(M)] for i in R(M): for j in R(i,M):w[i][j]=w[j][i]=((v[i][0]-v[j][0])**2+(v[i][1]-v[j][1])**2)**0.5 S=R(1<>i)&1: q=p^(1<>j)&1: for k in R(K):D[p][i][k]=min(D[p][i][k],D[q][j][k+1]+w[j][i]) for j in R(N): if(p>>j)&1: for k in R(K):D[p][N][K]=min(D[p][N][K],D[p][j][k]+w[j][N]) print(D[(1<