#include <bits/stdc++.h>
using namespace std;
int n, k, p, cnt, xx[505], yy[505], f[505];
double ans;
struct node{
int x, y; double dis;
}a[304800];
bool cmp(node c, node d){
return c.dis < d.dis;
}
int fa(int x){
if(x == f[x]) return x;
f[x] = fa(f[x]);
return f[x];
}
int main(){
scanf("%d%d", &k, &n);
for(int i = 1; i <= n; i++)
scanf("%d%d", &xx[i], &yy[i]);
if(k >= n){
printf("0.00");
return 0;
}
if(k == 0) k = 1;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
if(i != j){
a[++cnt].x = i;
a[cnt].y = j;
a[cnt].dis = 1.0000 * sqrt((xx[i] - xx[j]) * (xx[i] - xx[j]) + (yy[i] - yy[j]) * (yy[i] - yy[j]));
}
sort(a + 1, a + cnt + 1, cmp);
for(int i = 1; i <= n; i++)
f[i] = i;
p = n;
for(int i = 1; i <= cnt; i++)
if(fa(a[i].x) != fa(a[i].y)){
f[a[i].x] = a[i].y;
p--;
if(p == k){
ans = a[i].dis;
break;
}
}
printf("%.2f", ans);
return 0;
}