#include <bits/stdc++.h>
using namespace std;
const int N = 510;
struct Node{
double x,y;
};
struct Edge{
int x,y;
double weight;
};
int father[N];
int height[N];
double Distance(double x1,double y1,double x2,double y2){
double distance;
distance = sqrt(pow(x1-x2,2)+ pow(y1-y2,2));
return distance;
}
void Init(int n){
for (int i = 0; i < n; ++i) {
father[i] = i;
height[i] = 1;
}
}
int Find(int x){
if (father[x] != x)
father[x] = Find(father[x]);
return father[x];
}
void Union(int x,int y,double weight,double &D,int &sum){
int root_x = Find(x);
int root_y = Find(y);
if (root_x != root_y && sum>0){
if (height[root_x] < height[root_y])
father[root_x] = root_y;
else if (height[root_x] > height[root_y])
father[root_y] = root_x;
else if (height[root_x] > height[root_y]){
father[root_x] = root_y;
height[root_y]++;
}
--sum;
}
if (sum == 0)
D = weight;
}
bool comp(Edge lhs,Edge rhs){
return lhs.weight < rhs.weight;
}
vector<Node> myNode;
vector<Edge> myEdge;
int main(){
int S,P;
scanf("%d%d",&S,&P);
Init(P);
for (int i = 0; i < P; ++i) {
Node node;
scanf("%lf%lf",&node.x,&node.y);
myNode.push_back(node);
}
int edge_min = P-1;
int edge_add = edge_min - (S-1);
for (int i = 0; i < P; ++i) {
Edge edge;
edge.x = i;
for (int j = 0; j < P && j != i; ++j) {
edge.y = j;
edge.weight = Distance(myNode[i].x,myNode[i].y,myNode[j].x,myNode[j].y);
myEdge.push_back(edge);
}
}
double D = DBL_MAX;
sort(myEdge.begin(),myEdge.end(),comp);
for (int i = 0; i < myEdge.size(); ++i) {
Edge edge = myEdge[i];
Union(edge.x,edge.y,edge.weight,D,edge_add);
if (D != DBL_MAX)
break;
}
printf("%.2lf",D);
}