#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long ar[n];
    for (int i = 0; i < n; i++) cin >> ar[i];
    int maxi = -1000000001;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      if (ar[i] > maxi) maxi = ar[i];
      sum += ar[i];
    }
    float ans = (sum - maxi) / (float)(n - 1) + maxi;
    printf("%.9f", ans);
    cout << endl;
  }
}
