#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const double PI = acos(-1.0);
const double E = exp(1.0);
const int INF = ~(1 << 31);
const int MINF = 1 << 31;
const long long LLINF = ~(1ll << 63);
const long long LLMINF = 1ll << 63;
void solve() {
  int n;
  cin >> n;
  vector<long long> ve(n + 1, 0);
  for (int i = 1; i <= n; i++) cin >> ve[i];
  sort(ve.begin() + 1, ve.end());
  for (int i = 2; i <= n; i++) ve[i] += ve[i - 1];
  long long be = 0, af = 0;
  double avg, maxavg = -1e18;
  for (int i = 1; i <= n; i++) {
    be = ve[i];
    af = ve[n] - ve[i];
    avg = (double)be / (double)i + (double)af / (double)(n - i);
    maxavg = max(maxavg, avg);
  }
  printf("%.10lf\n", maxavg);
}
int main() {
TSample:
  int T = 1;
  cin >> T;
  while (T--) solve();
}
