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<<n)]
for i in range(n):
  q1[1<<i][i]=d((0,0),p[i])
for i in range(1<<n):
  for j in range(n):
    if (i>>j)&1:
      for k in range(n):
        if (i>>k)&1==0:
          q1[i|(1<<k)][k]=min(q1[i|(1<<k)][k],q1[i][j]+d(p[j],p[k]))
q2=[X]*(1<<n)
for i in range(1<<n):
  for j in range(n):
    if (i>>j)&1:
      q2[i]=min(q2[i],q1[i][j]+d((0,0),p[j]))
q3=[X]*(1<<n)
q3[0]=0
for s in range(1,1<<n):
  t=s
  while t>0:
    if t.bit_count()<=K:
      q3[s]=min(q3[s],q3[s^t]+q2[t])
    t=(t-1)&s
print(q3[-1])