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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T &t, const U &u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

// intersectSP modified on 2018/7/5

namespace geom {

#define X real()
#define Y imag()
#define at(i) ((*this)[i])
#define EPS (1e-9)
#define PI (3.1415926535897932384626)

using R = long double;
using P = complex<R>;

inline int sgn(R a, R b = 0) { return a < b - EPS ? -1 : a > b + EPS ? 1 : 0; }
inline bool near(P a, P b) { return !sgn(abs(a - b)); }
inline R norm(const P &p) { return p.X * p.X + p.Y * p.Y; }
inline R dot(const P &a, const P &b) { return real(a * conj(b)); }
inline R cross(const P &a, const P &b) { return imag(conj(a) * b); }
inline R sr(R a) { return sqrt(max(a, (R)0)); }
inline P unit(const P &p) { return p / abs(p); }
inline P proj(const P &s, const P &t) { return t * dot(s, t) / norm(t); }

struct L : public vector<P> {  // line
    L() {}
    L(const P &a, const P &b) {
        this->push_back(a);
        this->push_back(b);
    }
    P dir() const { return at(1) - at(0); }
};

struct G : public vector<P> {
    G(int sz = 0) : vector(sz) {}
    L edge(int i) const { return L(at(i), at(i + 1 == size() ? 0 : i + 1)); }
};

//(a->b->c)
int ccw(P a, P b, P c) {
    b -= a;
    c -= a;
    R cr = cross(b, c);
    if (sgn(cr) > 0) return 1;                 // counter clockwise
    if (sgn(cr) < 0) return -1;                // clockwise
    if (sgn(dot(b, c)) < 0) return 2;          // c--a--b on line
    if (sgn(norm(b), norm(c)) < 0) return -2;  // a--b--c on line
    return 0;
}

G convex_hull(G ps) {
    int n = ps.size(), k = 0;
    sort(ALL(ps));

    G ch(2 * n);

    for (int i = 0; i < n; ch[k++] = ps[i++])  // upper-hull
        while (k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) >= 0) --k;
    ch.resize(k);
    return ch;
}
}  // namespace geom

using namespace geom;

namespace std {
bool operator<(const P &a, const P &b) {
    return sgn(a.X - b.X) ? a.X < b.X : a.Y < b.Y;
}
istream &operator>>(istream &is, P &p) {
    R x, y;
    is >> x >> y;
    p = P(x, y);
    return is;
}
}  // namespace std

int main() {
    int N;
    cin >> N;
    V<ll> A(N), B(N);
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> B[i];

    int max_pos = max_element(ALL(A)) - A.begin();
    {
        V<ll> _A, _B;
        int p = max_pos;
        rep(i, N) {
            _A.pb(A[p]);
            _B.pb(B[p]);
            p = (p + 1) % N;
        }
        A = _A;
        B = _B;
        A.pb(A[0]);
        B.pb(B[0]);

        debug(A, B);
    }

    V<ll> sub(A.size());
    for (int i = 2; i < A.size(); ++i) {
        sub[i] = (B[i - 1] + sub[i - 1]) * 2 - sub[i - 2];
    }

    debug(sub);

    G pl;
    for (int i = 0; i < A.size(); ++i) {
        pl.pb(P(i, A[i] - sub[i]));
    }
    debug(pl.size());
    auto cv = convex_hull(pl);

    for (auto p : cv) {
        debug(p.X, p.Y);
    }
    R ans = 0;
    for (int i = 0; i < (int)cv.size() - 1; ++i) {
        ans += (cv[i + 1].X - cv[i].X + 1) * (cv[i + 1].Y + cv[i].Y) / 2.0 -
               cv[i + 1].Y;
    }

    rep(i, N) ans += sub[i];

    printf("%.11Lf\n", ans / N);
    return 0;
}

Measured memory_bytes: 33136