#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
long long power(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) {
      res = (res * a) % M;
    }
    n >>= 1;
    a = (a * a) % M;
  }
  return res;
}
const int N = 1e5 + 5;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  long long sum = 0;
  for (int &x : a) {
    cin >> x;
  }
  int ma = a[0];
  for (int i : a) {
    ma = max(i, ma);
    sum += i;
  }
  cout << fixed << setprecision(9);
  cout << 1.0 * (sum - ma) / (n - 1) + ma << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test = 1;
  cin >> test;
  while (test--) {
    solve();
  }
  return 0;
}
