#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define debug(x) cerr<<#x<<" "; _print(x); cerr<<nline;
#else
#define debug(x);
#endif
#define ll long long
/*
------------------------Input Checker----------------------------------
*/
long long readInt(long long l,long long r,char endd){
long long x=0;
int cnt=0;
int fi=-1;
bool is_neg=false;
while(true){
char g=getchar();
if(g=='-'){
assert(fi==-1);
is_neg=true;
continue;
}
if('0'<=g && g<='9'){
x*=10;
x+=g-'0';
if(cnt==0){
fi=g-'0';
}
cnt++;
assert(fi!=0 || cnt==1);
assert(fi!=0 || is_neg==false);
assert(!(cnt>19 || ( cnt==19 && fi>1) ));
} else if(g==endd){
if(is_neg){
x= -x;
}
if(!(l <= x && x <= r))
{
cerr << l << ' ' << r << ' ' << x << '\n';
assert(1 == 0);
}
return x;
} else {
assert(false);
}
}
}
string readString(int l,int r,char endd){
string ret="";
int cnt=0;
while(true){
char g=getchar();
assert(g!=-1);
if(g==endd){
break;
}
cnt++;
ret+=g;
}
assert(l<=cnt && cnt<=r);
return ret;
}
long long readIntSp(long long l,long long r){
return readInt(l,r,' ');
}
long long readIntLn(long long l,long long r){
return readInt(l,r,'\n');
}
string readStringLn(int l,int r){
return readString(l,r,'\n');
}
string readStringSp(int l,int r){
return readString(l,r,' ');
}
/*
------------------------Main code starts here----------------------------------
*/
ll MAX=100000;
vector<ll> readv(ll n){
vector<ll> a;
ll x;
for(ll i=1;i<n;i++){
x=readIntSp(1,1e9);
a.push_back(x);
}
x=readIntLn(1,1e6);
a.push_back(x);
return a;
}
ll sum_t=0;
void solve(){
ll n=readIntLn(2,1e5);
sum_t+=n;
vector<ll> a=readv(n);
sort(a.begin(),a.end());
ll sum=0;
for(auto it:a){
sum+=it;
}
double ans=1.0*sum/n;
ll lft=0;
for(ll i=0;i<n;i++){
lft+=a[i]; sum-=a[i];
double now=1.0*lft/(i+1);
ans=max(ans,(now+sum)/(n-i));
}
cout<<ans<<"\n";
return;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
ll test_cases=readIntLn(1,1e3);
cout<<fixed<<setprecision(10);
while(test_cases--){
solve();
}
assert(getchar()==-1);
assert(sum_t<=(3e5));
return 0;
}