Problem: You are playing a game and your goal is to maximize your expected gain. At the beginning of the game, a pawn is put, uniformly at random, at a position p\in\\{1,2,\dots, N\\}. The N positions are arranged on a circle (so that 1 is between N and 2).

The game consists of turns. At each turn you can either end the game, and get A_p dollars (where p is the current position of the pawn), or pay B_p dollar to keep playing. If you decide to keep playing, the pawn is randomly moved to one of the two adjacent positions p-1, p+1 (with the identifications 0 = N and N+1=1).

What is the expected gain of an optimal strategy?

Note: The "expected gain of an optimal strategy" shall be defined as the supremum of the expected gain among all strategies such that the game ends in a finite number of turns.

Constraints

* 2 \le N \le 200,000
* 0 \le A_p \le 10^{12} for any p = 1,\ldots, N
* 0 \le B_p \le 100 for any p = 1, \ldots, N
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 A_2 \cdots A_N
B_1 B_2 \cdots B_N


Output

Print a single real number, the expected gain of an optimal strategy. Your answer will be considered correct if its relative or absolute error does not exceed 10^{-10}.

Examples

Input

5
4 2 6 3 5
1 1 1 1 1


Output

4.700000000000


Input

4
100 0 100 0
0 100 0 100


Output

50.000000000000


Input

14
4839 5400 6231 5800 6001 5200 6350 7133 7986 8012 7537 7013 6477 5912
34 54 61 32 52 61 21 43 65 12 45 21 1 4


Output

7047.142857142857


Input

10
470606482521 533212137322 116718867454 746976621474 457112271419 815899162072 641324977314 88281100571 9231169966 455007126951
26 83 30 59 100 88 84 91 54 61


Output

815899161079.400024414062

Solution (in CPP):

Solution:
#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;
}