#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
 
struct pt {
    LL x, y;
    pt(): x(0), y(0) {}
    pt(LL x, LL y): x(x), y(y) {}
};
pt operator-(pt A, pt B) { return {A.x-B.x, A.y-B.y}; }
 
bool above(pt A, pt B, pt C) {
    B = B-A, C = C-A;
    return B.x * C.y - B.y * C.x >= 0;
}
 
 
int main() {
    int N;
    cin >> N;
    vector<LL> A(N), B(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    for (int i = 0; i < N; i++) cin >> B[i];
 
    int it = 0;
    for (int i = 0; i < N; i++) if (A[i] > A[it]) it = i;
    rotate(A.begin(), A.begin() + it, A.end());
    rotate(B.begin(), B.begin() + it, B.end());
    A.push_back(A[0]);
    B.push_back(B[0]);
    vector<LL> C(N+1, 0);
    for (int i = 2; i <= N; i++) C[i] = 2*(C[i-1]+B[i-1]) - C[i-2];
    
    vector<pt> hull = {{0, A[0]-C[0]}};
    for (int i = 1; i <= N; i++) {
        pt P = {i, A[i]-C[i]};
        while (hull.size() >= 2 and above(hull[hull.size()-2], hull.back(), P)) hull.pop_back();
        hull.push_back(P);
    }
    
    LL twice_res = 0;
    for (int i = 1; i < (int)hull.size(); i++) {
        LL dx = hull[i].x - hull[i-1].x;
        LL area = hull[i-1].y * (dx+1) + hull[i].y * (dx-1);
        twice_res += area;
    }
    for (int i = 0; i < N; i++) twice_res += 2*C[i];
 
    double res = twice_res;
    res /= 2*N;
    cout.precision(12);
    cout << fixed << res << endl;
}