#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    long long a[n], ans = 0, mx = INT_MIN;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      ans += a[i];
      mx = max(mx, a[i]);
    }
    ans = ans - mx;
    double result = mx + (1.0 * ans) / (n - 1);
    cout << fixed << setprecision(9) << result << endl;
  }
}
