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=[[9**20]*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:D[p][i][k]=min(D[p][i][k],D[q][j][k+1]+w[j][i]) D[p][N][K]=min(D[p][N][K],D[p][i][k]+w[i][N]) print(D[(1<