#include <bits/stdc++.h>
using namespace std;
 
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << a << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair
 
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

const int N = 2e5 + 10;

int n;
double a[N], b[N], cum[N], cumk[N], ans[N];

double compute(int from, int to, int idx) {
    if (idx == from) return a[from];
    if (idx == to) return a[to];
    double ans = ((to-idx) * a[from] + (idx-from) * a[to]) / (to-from);

    double cost = 0;
    double c = 2.0*(to-idx)/(to-from);
    cost += c * (cumk[idx+1] - cumk[from+1]);
    cost -= c * from * (cum[idx+1] - cum[from+1]);

    double d = 2.0*(idx-from)/(to-from);
    cost += d * to * (cum[to] - cum[idx+1]);
    cost -= d * (cumk[to] - cumk[idx+1]);

    return ans - cost;
}
 
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;

    pair<double,int> mx;
    forn(i,n) {
        cin >> a[i];
        mx = max(mx, {a[i],i});
    }
    forn(i,n) cin >> b[i];
    {
        int idx = mx.second;
        vector<double> na(n), nb(n);
        forn(i,n) {
            na[i] = a[(i+idx)%n];
            nb[i] = b[(i+idx)%n];
        }
        forn(i,n) {
            a[i] = na[i];
            b[i] = nb[i];
        }
    }

    a[n] = a[0];
    forn(i,n+1) {
        cum[i+1] = cum[i] + b[i];
        cumk[i+1] = cumk[i] + b[i]*i;
    }


    vi convex(1,0);
    int sz = 1;
    forsn(i,1,n) {
        double cand = compute(convex.back(), n, i);
        if (cand <= a[i]) {
            while (sz >= 2 && compute(convex[sz-2], i, convex[sz-1]) > a[convex[sz-1]]) {
                convex.pop_back();
                sz--;
            }
            convex.push_back(i);
            sz++;
        }
    }
    convex.pb(n);


    vector<double> best(n);
    forn(i,si(convex)-1){
        forsn(j,convex[i], convex[i+1]) 
            best[j] = compute(convex[i], convex[i+1], j);
    }

    double ans = 0;
    for (auto x : best) ans += x;
    cout << fixed << setprecision(12) << ans / n;
    return 0;
}
