#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long double lb = 0;
	long double rb = 2e9 + 9;
	long double p = 1.0 / (long double) n;
	auto f = [&](long double x) {
		long double E = 0.0;
		for (int i = 0; i < n; i++) {
			long double v = x + a[i] - min((long double) a[i], 2.0 * x);
			E += p * v;
		}
		return E;
	};
	for (int i = 0; i < 300; i++) {
		long double g = lb + (rb - lb) / 3.0;
		long double h = lb + 2.0 * (rb - lb) / 3.0;
		if (f(g) < f(h)) {
			rb = h;
		} else {
			lb = g;
		}
	}
	cout << setprecision(8) << fixed << f(lb) << '\n';
	return 0;
}
// B

#pragma GCC optimize ("Ofast")
#pragma GCC optimization ("unroll-loops, no-stack-protector")
#pragma GCC target ("avx")
#pragma GCC target ("avx2")
#pragma GCC target ("fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#define ordered_set tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
	ll n; cin >> n;
	string s1, s2, s3; cin >> s1 >> s2 >> s3;
	string ans; ans.resize(2 * n + 1);
	ans[0] = '1';
	for (ll i = 1; i <= n; i++) ans[i] = '0';
	for (ll i = n + 1; i <= 2 * n; i++) ans[i] = '1';
	cout << ans << "\n";
}
int main(){
	fastio;
	ll t; cin >> t;
	while (t--) solve();
}