#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
long long a[N];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long n, sum = 0, maxn = -1e9;
    scanf("%lld", &n);
    for (int i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
      sum += a[i];
      maxn = max(a[i], maxn);
    }
    printf("%.9lf\n", maxn * 1.0 + (sum - maxn) * 1.0 / (n - 1));
  }
  return 0;
}
