#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt = 1;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    cout << fixed;
    cout << setprecision(13);
    long long arr[n];
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n, greater<long long>());
    double ans = 0.0;
    long long cnt = 1;
    ans += arr[0];
    for (long long i = 1; i < n; i++) {
      ans += cnt * arr[i];
      cnt *= 2;
    }
    cout << ans / cnt;
  }
  return 0;
}
