#include <bits/stdc++.h>
using namespace std;

const int N = 200005;

int n;
long long a[N], b[N], c[N];
double ans = 0;
vector<pair<int, long long>> ve;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> b[i];
    }
    int mx = distance(a, max_element(a, a + n));
    rotate(a, a + mx, a + n);
    rotate(b, b + mx, b + n);
    a[n] = a[0]; b[n] = b[0];
    for (int i = 1; i < n; i++) {
        c[i + 1] = 2 * (c[i] + b[i]) - c[i - 1];
    }
    for (int i = 0; i <= n; i++) {
        int x = i;
        long long y = a[i] - c[i];
        while (ve.size() >= 2) {
            auto [px, py] = ve[ve.size() - 2];
            auto [cx, cy] = ve.back();
            if ((x - px) * (cy - py) - (y - py) * (cx - px) <= 0) {
                ve.pop_back();
            } else {
                break;
            }
        }
        ve.push_back({x, y});
    }
    for (int i = 0; i < ve.size() - 1; i++) {
        auto [lx, ly] = ve[i];
        auto [rx, ry] = ve[i + 1];
        for (int x = lx; x < rx; x++) {
            ans += c[x] + ly + 1.0 * (ry - ly) / (rx - lx) * (x - lx);
        }
    }
    cout << fixed << setprecision(12) << ans / n;
}
