#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int inf = 10000000;
struct node {
int x;
int y;
};
vector <node> cities;
int d [200];
void diikstra ( int n ){
d[0] = 0;
for (int i = 1; i < n; i++){
d[i] = inf;
}
priority_queue < pair <int, int> > q;
q.push({d[0], 0});
while (!q.empty()) {
int num_v = q.top().second;
node cur = cities[num_v];
int distv = -q.top().first;
q.pop();
for (int i = 0; i < n; i++) {
int distance = max (distv, (cur.x - cities[i].x)*(cur.x - cities[i].x)+(cur.y - cities[i].y)*(cur.y - cities[i].y));
if(d[i] > distance){
d[i] = distance;
q.push ({-distance, i});
}
}
}
}
int main() {
cout.precision(3);
int q;
cin >> q;
for (int w = 0; w < q; w++){
int n;
cin >> n;
for (int i = 0; i < n; i++){
int a, b;
cin >> a >> b;
cities.push_back({a,b});
}
diikstra (n);
for (int i = 0; i < n; i++){
cities.pop_back();
}
cout << fixed << sqrt(d[1]) << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8cXVldWU+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgaW5mID0gMTAwMDAwMDA7CgpzdHJ1Y3Qgbm9kZSB7CglpbnQgeDsKCWludCB5Owp9OwoKdmVjdG9yIDxub2RlPiBjaXRpZXM7CmludCBkIFsyMDBdOwp2b2lkIGRpaWtzdHJhICggaW50IG4gKXsKCWRbMF0gPSAwOwoJZm9yIChpbnQgaSA9IDE7IGkgPCBuOyBpKyspewoJCWRbaV0gPSBpbmY7Cgl9Cglwcmlvcml0eV9xdWV1ZSA8IHBhaXIgPGludCwgaW50PiA+IHE7CglxLnB1c2goe2RbMF0sIDB9KTsKCXdoaWxlICghcS5lbXB0eSgpKSB7CgkJaW50I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