#include<bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
using ll = long long;
//using i128 = __int128_t;
#define endl "\n"
#define int long long
#define db cout << "db" << endl;
#define x first
#define y second
typedef pair<int, int> PII;
const int N = 5e5 + 10;
ll inf = 2e18;
#define double long double
void solve() {
int n;
cin >> n;
vector<long double> a(n + 1);
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
int p;
for (int i = 2; i < n; i++) {
if (a[i] < a[i - 1] && a[i] < a[i + 1]) {
p = i;
}
}
double sum1 = 0;
for (int i = 1; i <= p + 1; i++) {
sum1 += a[i];
}
double ans = sum1 / (p + 1);
for (int i = p + 2; i <= n; i++) {
sum1 += a[i];
ans = max(ans, sum1 / i);
}
for (int i = 1; i < p; i++) {
sum1 -= a[i];
ans = max(ans, sum1 / (n - i));
}
cout << fixed << setprecision(20) << ans << endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int q = 1;
cin >> q;
while (q --) {
solve();
}
return 0;
}