#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
long long INF = 9876543212345;
long long ans;
int n;
struct Point{
int x;
int y;
Point(){
x=0;y=0;
}
Point operator + (Point p){
Point ans;
ans.x = x + p.x;
ans.y = y + p.y;
return ans;
}
Point operator - (Point p){
Point ans;
ans.x = x-p.x;
ans.y = y-p.y;
return ans;
}
long long scalar(){
return (long long)x*x+(long long)y*y;
}
};
Point point[22];
void dfs(int i,Point p,int cnt){
if(!cnt){
for(int j=i+1;j<=n;++j)p = p-point[j];
ans = min(ans,p.scalar());
return;
}
if(i==n) return;
for(int j=i+1;j<=n;++j){
p = p+point[j];
dfs(j,p,cnt-1);
p = p-point[j]-point[j];
}
}
int main(){
int t;
for(scanf("%d",&t);t;--t){
Point p;
ans=INF;
scanf("%d",&n);
for(int i=1;i<=n;++i){
scanf("%d%d",&point[i].x,&point[i].y);
}
dfs(0,p,n>>1);
printf("%.6lf\n",sqrt(ans));
}
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpsb25nIGxvbmcgSU5GID0gOTg3NjU0MzIxMjM0NTsKbG9uZyBsb25nIGFuczsKaW50IG47CgpzdHJ1Y3QgUG9pbnR7CiAgICBpbnQgeDsKICAgIGludCB5OwogICAgUG9pbnQoKXsKICAgICAgICB4PTA7eT0wOwogICAgfQogICAgUG9pbnQgb3BlcmF0b3IgKyAoUG9pbnQgcCl7CiAgICAgICAgUG9pbnQgYW5zOwogICAgICAgIGFucy54ID0geCArIHAueDsKICAgICAgICBhbnMueSA9IHkgKyBwLnk7CiAgICAgICAgcmV0dXJuIGFuczsKICAgIH0KCiAgICBQb2ludCBvcGVyYXRvciAtIChQb2ludCBwKXsKICAgICAgICBQb2ludCBhbnM7CiAgICAgICAgYW5zLnggPSB4LXAueDsKICAgICAgICBhbnMueSA9IHktcC55OwogICAgICAgIHJldHVybiBhbnM7CiAgICB9CiAgICBsb25nIGxvbmcgc2NhbGFyKCl7CiAgICAgICAgcmV0dXJuIChsb25nIGxvbmcpeCp4Kyhsb25nIGxvbmcpeSp5OwogICAgfQp9OwpQb2ludCBwb2ludFsyMl07Cgp2b2lkIGRmcyhpbnQgaSxQb2ludCBwLGludCBjbnQpewogICAgaWYoIWNudCl7CiAgICAgICAgZm9yKGludCBqPWkrMTtqPD1uOysrailwID0gcC1wb2ludFtqXTsKICAgIAlhbnMgPSBtaW4oYW5zLHAuc2NhbGFyKCkpOwogICAgCXJldHVybjsKICAgIH0KICAgIGlmKGk9PW4pIHJldHVybjsKICAgIGZvcihpbnQgaj1pKzE7ajw9bjsrK2opewogICAgICAgCXAgPSBwK3BvaW50W2pdOwogICAgICAgIGRmcyhqLHAsY250LTEpOwogICAgICAgIHAgPSBwLXBvaW50W2pdLXBvaW50W2pdOwogICAgfQp9IAppbnQgbWFpbigpewogICAgaW50IHQ7CQogICAgZm9yKHNjYW5mKCIlZCIsJnQpO3Q7LS10KXsKICAgICAgICBQb2ludCBwOwogICAgICAgIGFucz1JTkY7CiAgICAgICAgc2NhbmYoIiVkIiwmbik7CiAgICAgICAgZm9yKGludCBpPTE7aTw9bjsrK2kpewogICAgICAgICAgICBzY2FuZigiJWQlZCIsJnBvaW50W2ldLngsJnBvaW50W2ldLnkpOwogICAgICAgIH0KICAgICAgICBkZnMoMCxwLG4+PjEpOwogICAgICAgIHByaW50ZigiJS42bGZcbiIsc3FydChhbnMpKTsKICAgIH0KfQo=