//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define st first
#define nd second

using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set =
	tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
#define shandom_ruffle random_shuffle
 
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
using ld = long double;

const int kMaxN = 5e5;

ll ai[kMaxN], bi[kMaxN];
ll pref_bi[kMaxN], pref_w_bi[kMaxN];
int n;

ll GetPref(ll *x, int from, int to) {
	return x[to + 1] - x[from];
}

ld GetExpected(int p0, int pa, int pm) {
	debug() << imie(p0) << imie(pa) << imie(pm);
	if (pm <= p0) { pm += n; }
	if (pa < p0) { pa += n; }
	assert(p0 <= pa && pa <= pm);

	if (p0 == pa || pm == pa) { return ai[pa]; }

	ll m = pm - p0;
	ll val0 = ai[p0];
	ll valm = ai[pm];
	
	int fst = p0 + 1;
	int lst = pm - 1;
	ll v1m = valm + val0 * (m - 1) - 2 * (
	  GetPref(pref_bi, fst, lst) * (m + p0) -
	  GetPref(pref_w_bi, fst, lst));

	ld v1 = ld(v1m) / m;
	debug() << imie(v1);

	ll a = pa - p0;
	return a * v1 + 2 * (
	  GetPref(pref_bi, fst, pa-1) * (a + p0) -
	  GetPref(pref_w_bi, fst, pa-1)) - (a - 1) * ai[p0];
}

set<int> avails;

pii GetP0Pm(int pa) {
	bool inserted = false;
	if (!avails.count(pa)) {
		avails.insert(pa);
		inserted = true;
	}
	auto iter = avails.find(pa);
	auto niter = next(iter);

	int p0, pm;
	
	if (iter == avails.begin()) {
		p0 = *avails.rbegin();
	} else {
		p0 = *prev(iter);
	}

	if (niter == avails.end()) {
		pm = *avails.begin();
	} else {
		pm = *niter;
	}
	if (inserted) {
		avails.erase(pa);
	}
	return {p0, pm};
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(11);
	cerr << fixed << setprecision(6);

	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> ai[i];
		ai[i + n] = ai[i];
	}
	for (int i = 0; i < n; ++i) {
		cin >> bi[i];
		bi[i + n] = bi[i];
	}

	for (int i = 0; i < 2 * n; ++i) {
		pref_bi[i + 1] = pref_bi[i] + bi[i];
		pref_w_bi[i + 1] = pref_w_bi[i] + ll(i) * bi[i];
	}

	//~ debug() << GetExpected(0, 1, 3);
	//~ debug() << GetExpected(0, 2, 3);
	//~ return 0;

	queue<int> q;
	for (int i = 0; i < n; ++i) {
		avails.insert(i);
		q.push(i);
	}

	while (!q.empty()) {
		int pa = q.front();
		q.pop();
		if (!avails.count(pa)) { continue; }
		if (SZ(avails) == 1) { break; }

		auto [p0, pm] = GetP0Pm(pa);
		ld expect = GetExpected(p0, pa, pm);
		debug() << imie(p0) << imie(pa) << imie(pm) << expect;

		if (expect > ai[pa]) {
			avails.erase(pa);
			q.push(p0);
			q.push(pm);
		}
	}

	debug() << imie(avails);

	ld ans = 0;
	for (int i = 0; i < n; ++i) {
		if (avails.count(i)) {
			ans += ai[i];
		} else {
			auto [p0, pm] = GetP0Pm(i);
			ld e = GetExpected(p0, i, pm);
			debug() << imie(p0) << imie(i) << imie(pm) << e;
			ans += e;
		}
	}

	cout << ans / n << "\n";
}


Measured memory_bytes: 26648