#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
using namespace std;
typedef long long LL;
const int MAXN = 200005;

template <typename T> inline void read(T &AKNOI) {
	T x = 0, flag = 1;
	char ch = getchar();
	while (!isdigit(ch)) {
		if (ch == '-') flag = -1;
		ch = getchar();
	}
	while (isdigit(ch)) {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	AKNOI = flag * x;
}

int n, stk[MAXN], top;
LL aa[MAXN], bb[MAXN], a[MAXN], b[MAXN], c[MAXN], Y[MAXN];

inline bool Check(int i, int j, int k) {
	return (Y[j] - Y[i]) * (k - j) <= (Y[k] - Y[j]) * (j - i);
}

void init() {
	read(n);
	for (int i = 1; i <= n; ++i) {
		read(aa[i]);
	}
	for (int i = 1; i <= n; ++i) {
		read(bb[i]);
	}
}

void solve() {
	int mxp = 1;
	for (int i = 2; i <= n; ++i) {
		if (aa[i] > aa[mxp]) {
			mxp = i;
		}
	}
	for (int i = 1; i <= mxp; ++i) {
		a[n - mxp + i] = aa[i];
		b[n - mxp + i] = bb[i];
	}
	for (int i = mxp; i <= n; ++i) {
		a[i - mxp] = aa[i];
		b[i - mxp] = bb[i];
	}
	c[0] = c[1] = 0;
	for (int i = 2; i <= n; ++i) {
		c[i] = (b[i - 1] + c[i - 1]) * 2 - c[i - 2];
	}
	for (int i = 0; i <= n; ++i) {
		Y[i] = a[i] - c[i];
		while (top > 1 && Check(stk[top - 1], stk[top], i)) {
			--top;
		}
		stk[++top] = i;
	}
	double ans = 0;
	for (int i = 1; i < top; ++i) {
		int p = stk[i], q = stk[i + 1];
		ans += Y[p] + c[p];
		for (int j = p + 1; j < q; ++j) {
			ans += 1.0 * (Y[p] * (j - p) + Y[q] * (q - j)) / (q - p) + c[j];
		}
	}
	printf("%.12lf\n", ans / n);
}

int main() {
	init();
	solve();
	return 0;
}
