/* Prim: given some points, a satellite can connect two points, and there is a certain distance between points and points. Ask the minimum distance that can connect all points. */# Include <stdio. h> # include <string. h> # include <stdlib. h> # include <algorithm> # include <iostream> # include <queue> # include <map> # include <stack> # include <set> # include <math. h> using namespace std; typedef long int64; // typedef _ int64 int64; typedef pair <int64, int64> PII; # define MP (a, B) make_pair (a), (B) const int maxn = 505; const int inf = 0x7fffffff; const double pi = acos (-1.0); const double eps = 1e-8; struct Node {double x, y;} a [maxn]; int vis [maxn]; double dis [maxn]; double mat [maxn] [maxn]; double dist (Node a, Node B) {return sqrt (. x-b.x) * (. x-b.x) +. y-b.y) * (. y-b.y);} void init (int n) {for (int I = 1; I <= n; I ++) {for (int j = 1; j <= n; j ++) {mat [I] [j] = dist (a [I], a [j]) ;}} return ;} void prim (int n) {for (int I = 1; I <= n; I ++) {vis [I] = 0; dis [I] = mat [1] [I];} vis [1] = 1; for (int I = 1; I <= n; I ++) {int M = inf; int id =-1; for (int j = 1; j <= n; j ++) {if (vis [j] = 0 & M> dis [j]) {M = dis [j]; id = j ;}} if (id =-1) return; vis [id] = 1; for (int j = 1; j <= n; j ++) {if (vis [j] = 0 & dis [j]> mat [id] [j]) {dis [j] = mat [id] [j] ;}}return ;}int main () {int T; scanf ("% d", & T ); while (T --) {int s, n; scanf ("% d", & s, & n); for (int I = 1; I <= n; I ++) scanf ("% lf", & a [I]. x, & a [I]. y); init (n); prim (n); sort (dis + 1, dis + 1 + n); // for (int I = 1; I <= n; I ++) // printf ("% lf", dis [I]); // puts (""); printf ("%. 2lf \ n ", dis [n-s + 1]);} return 0 ;}