n,K=map(int,input().split()) p=[tuple(map(int,input().split())) for i in range(n)] X=10**20 d=lambda p1,p2:((p1[0]-p2[0])**2+(p1[1]-p2[1])**2)**0.5 q1=[[X]*n for i in range(1<>j)&1: for k in range(n): if (i>>k)&1==0: q1[i|(1<>j)&1: q2[i]=min(q2[i],q1[i][j]+d((0,0),p[j])) q3=[X]*(1<0: if t.bit_count()<=K: q3[s]=min(q3[s],q3[s^t]+q2[t]) t=(t-1)&s print(q3[-1])