#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
 
int main() {
    int N;
    cin >> N;
    vector<ll>A(N,0);
    vector<int>B(N,0);
    for(ll &i:A)cin >> i;
    for(int &i:B)cin >> i;
    
    int it=0;
    for(int i=1;i<N;i++)if(A[it]<A[i])it=i;
    
    rotate(A.begin(), A.begin()+it, A.end());
    rotate(B.begin(), B.begin()+it, B.end());
    A.push_back(A.front());
    B.push_back(B.front());
    vector<ll> C(N+1,0);
    for(int i=1;i<N;i++)C[i+1]=2*(B[i]+C[i])-C[i-1];
   
    
    vector<pair<int,ll>> hull={make_pair(0,A[0]-C[0]),make_pair(1,A[1]-C[1])};
    
    auto flg = [&](pair<int,ll> sub3)->bool{
        if(hull.size()<2)return false;
        pair<int,ll> sub1 = hull[hull.size()-2],sub2=hull.back();
        return (sub3.first-sub1.first)*(sub1.second-sub2.second)>(sub1.second-sub3.second)*(sub2.first-sub1.first);
    };
    
    for(int i=2;i<=N;i++){
        
        pair<int,ll> sub3(i,A[i]-C[i]);
        
        while((bool)flg(sub3))hull.pop_back();
        
        hull.push_back(sub3);
        
    }
    
    ll Fp = 0;
    for(int i=1;i<hull.size();i++){
        int d = hull[i].first - hull[i-1].first;
        
        Fp += hull[i-1].second*(d+1) + hull[i].second*(d-1);
        
    }
    for(int i=0;i<N;i++)Fp+=C[i]*2;
    long double E = (long double)Fp/(2.0*N);
    
    printf("%.12Lf\n",E);
}
