#include<bits/stdc++.h>

int main(){
    using namespace std;

    unsigned long N;
    cin >> N;

    vector<unsigned long> A(N), B(N);
    for(auto&& i : A)cin >> i;
    for(auto&& i : B)cin >> i;
    unsigned long t{static_cast<unsigned long>(max_element(begin(A), end(A)) - begin(A))};
    rotate(begin(A), begin(A) + t, end(A));
    rotate(begin(B), begin(B) + t, end(B));
    A.push_back(A[0]);
    B.push_back(B[0]);

    vector<unsigned long> C(N + 1);
    C[0] = 10000000000000;
    C[1] = 10000000000000;

    for(unsigned long i{2}; i <= N; ++i)C[i] = 2 * C[i - 1] - 2 * B[i - 1] - C[i - 2];

    for(unsigned long i{0}; i <= N; ++i)A[i] += C[i] -= C.back();

    vector<unsigned long> convex_hull{0, 1};
    const auto& is_convex = [&A](unsigned long i, unsigned long j, unsigned long k) -> bool {
        return j * A[k] + k * A[i] + i * A[j] < j * A[i] + k * A[j] + i * A[k];
    };
    for(unsigned long i{2}; i < N + 1; ++i){
        while(convex_hull.size() >= 2 && !is_convex(convex_hull.end()[-2], convex_hull.end()[-1], i))convex_hull.pop_back();
        convex_hull.push_back(i);
    }
    unsigned long ans{0};
    for(unsigned long i{0}; i + 1 < convex_hull.size(); ++i)ans += (convex_hull[i + 1] - convex_hull[i] + 1) * A[convex_hull[i]] + (convex_hull[i + 1] - convex_hull[i] - 1) * A[convex_hull[i + 1]];

    string S;
    {
        stringstream ss;
        ss << setprecision(12) << ((ans - 2 * accumulate(C.begin(), C.end(), 0UL)) % (2 * N)) / (2.0L * N);
        S = ss.str();
    }
    S.erase(S.begin());
    cout << (ans - 2 * accumulate(C.begin(), C.end(), 0UL)) / (2 * N) << S << endl;

    return 0;
}