#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
double a[100010];
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
    sort(a, a + n);
    double sum = 0;
    for (int i = 0; i < n - 1; i++) sum += a[i];
    double ans = sum / (1.0 * (n - 1)) + a[n - 1];
    printf("%.9f\n", ans);
  }
}
