#pragma GCC optimize("Ofast","unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
#define ll long long
#define ld double
#define fi first
#define se second
using namespace std;
const ll N=1e6+5,INF=1.5e9;
const ld pi=acos(-1.0l);
ll n;ld x[N],y[N];vector<pair<ld,ld>> v;
bool cmp(pair<ld,ld> u,pair<ld,ld> v){return u.fi*u.se<v.fi*v.se;}
const int D=45;
ld d[N][D+4];
ld sq(ld x){return x*x;}
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
int T;cin>>T;for(int _=1;_<=T;_++){
ll i;
cin>>n;v.clear();
bool b1=1;ll S=0;
for(i=1;i<=n;i++){
ll xx,yy;
cin>>xx>>yy;
x[i]=xx,y[i]=yy;
b1&=(yy==0),S^=xx^yy;
}
if(b1){
sort(x+1,x+n+1);
ld ans=1e18;
for(i=3;i<=n;i++) ans=min(ans,2*(x[i]-x[i-2]));
cout<<fixed<<setprecision(15)<<ans<<'\n';
return 0;
}srand(19260817);
ld t=rand()*pi*2/RAND_MAX;
for(i=1;i<=n;i++){
x[i]+=0.5,y[i]+=0.5;
ld g=atan2(y[i],x[i]);
x[i]=x[i]*cos(t+g)/cos(g);
y[i]=y[i]*sin(t+g)/sin(g);
}
for(i=1;i<=n;i++){
x[i]+=INF,y[i]+=INF;
v.push_back({x[i],y[i]});
}
sort(v.begin(),v.end(),cmp);for(i=1;i<=n;i++) x[i]=v[i-1].first,y[i]=v[i-1].second;
ld ans=1e18;
for(i=1;i<=n;i++){
for(int j=i+1;j<=min(n,i+D+1);j++){
d[i][j-i]=sqrt(sq(x[i]-x[j])+sq(y[i]-y[j]));
}
}
for(i=1;i<=n;i++){
for(int j=i+1,_=min(n,i+D);j<=_;j++){
for(int k=j+1,__=min(n,i+D);k<=__;k++){
ans=min(ans,d[i][j-i]+d[j][k-j]+d[i][k-i]);
}
}
}
cout<<"Case #"<<_<<": "<<fixed<<setprecision(15)<<ans<<'\n';
}
return 0;
}