#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int i = 0; i < n; i++) cin >> v[i];
    sort(v.begin(), v.end());
    double max1 = v[n - 1];
    double sum = 0;
    for (int i = 0; i < n - 1; i++) sum += v[i];
    cout << setprecision(9) << sum / (n - 1) + max1;
    cout << "\n";
  }
  return 0;
}
