1 /**************************************************************
2 Problem: 1821
3 User: houjikan
4 Language: C++
5 Result: Accepted
6 Time:1064 ms
7 Memory:1292 kb
8 ****************************************************************/
9
10 #include <iostream>
11 #include <cstring>
12 #include <string>
13 #include <cstdio>
14 #include <cstdlib>
15 #include <cmath>
16 #include <algorithm>
17 #include <queue>
18 #include <stack>
19 #include <map>
20 #include <set>
21 #include <list>
22 #include <vector>
23 #include <ctime>
24 #include <functional>
25 #define pritnf printf
26 #define scafn scanf
27 #define For(i,j,k) for(int i=(j);i<=(k);(i)++)
28 #define Clear(a) memset(a,0,sizeof(a))
29 using namespace std;
30 typedef long long LL;
31 typedef unsigned int Uint;
32 const int INF=0x3fffffff;
33 //==============struct declaration==============
34 struct points{
35 int x,y;
36 };
37 //==============var declaration=================
38 const int MAXN=1010;
39 const double eps=1e-6;
40 int n,k;
41 points clan[MAXN];
42 bool vis[MAXN];
43 double low,high,mid;
44 //==============function declaration============
45 bool check(double dis);double dist(points a,points b);
46 //==============main code=======================
47 int main()
48 {
49 #ifdef FILE__
50 freopen("input.txt","r",stdin);
51 freopen("output.txt","w",stdout);
52 #endif
53 scanf("%d%d",&n,&k);
54 for(int i=1;i<=n;i++)
55 scanf("%d%d",&clan[i].x,&clan[i].y);
56 low=0,high=1000000000000000.0;
57 while (high-low>eps){
58 mid=(low+high)/2;
59 if (check(mid))
60 low=mid;
61 else
62 high=mid;
63 }
64 printf("%.2lf\n",low);
65 return 0;
66 }
67 //================fuction code====================
68 bool check(double dis)
69 {
70 int cnt=0;memset(vis,false,sizeof(vis));
71 for(int i=1;i<=n;i++){//从每一个地点出发进行BFS
72 if (vis[i]) continue;
73 queue <int> Q;Q.push(i);cnt++;
74 while (!Q.empty()){
75 int x=Q.front();Q.pop();vis[x]=true;
76 for(int j=1;j<=n;j++){
77 if (!vis[j]&&dist(clan[j],clan[x])<=dis){//两个地点之间距离<=D,说明在同一个部落
78 Q.push(j);
79 vis[j]=true;
80 }
81 }
82 }
83 }
84 return cnt>=k;
85 }
86 double dist(points a,points b){
87 return sqrt((double)(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
88 }
89