#define MST(a, b) memset(a,b,sizeof(a))
#define ALL(v) (v).begin(),(v).end()
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL,LL> pll;
#include <ext/pb_ds/priority_queue.hpp>
#define rep(i,a,b) for(int i = (a) ; i <= (b) ; ++i)
#define per(i,a,b) for(int i = (a) ; i >= (b) ; --i)
#define fors(i,S) for(int i = (S) ; i ; i = (i-1)&(S))
#define forn(i,n) for(int i = 0 ; i < (n) ; ++i)

using namespace __gnu_pbds;
//typedef __gnu_pbds::priority_queue<pii, greater<pii>, pairing_heap_tag> heap;
//typedef heap::point_iterator iter;
typedef unsigned long long ULL;
//typedef __int128 LL128;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

int system_const;
namespace fast_IO{
    const int maxbuff = 1<<17;
    char ibuff[maxbuff],obuff[maxbuff];
    inline char Getchar(){
        static char *p1=ibuff,*p2=ibuff;
        if(p1 == p2) {
            p1 = ibuff;
            p2 = ibuff+fread(ibuff,1,maxbuff,stdin);
            if(p1 == p2) return -1;
        }
        return *p1++;
    }

    int optr = 0;
    inline void Putchar(char c) {
        if(optr == maxbuff) {fwrite(obuff,1,optr,stdout);optr = 0;}
        obuff[optr++] = c;
    }

    inline void Flush() {
        fwrite(obuff,1,optr,stdout);
    }

    template<class T>
    void read_number(T &x) {
        x = 0;
        char c;int f = 0;
        for(c = Getchar() ; c != '-' && (c < '0' || c > '9') ; c = Getchar());
        if(c == '-') f = 1;
        else x = c-'0';
        for(c = Getchar() ; c >= '0' && c <= '9' ; c = Getchar()) x = x*10+c-'0';
        if(f) x = -x;
    }

    void read_string(string &s) {
        s.clear();
        char c;
        for(c = Getchar() ; c == ' ' || c == '\n' ; c = Getchar());
        s.push_back(c);
        for(c = Getchar() ; c != ' ' && c != '\n' ; c = Getchar())
            s.push_back(c);
    }

    template<class T>
    void write_number(T &x) {
        static int dec[20];int len = 0;
        if(x == 0) {Putchar('0');return ;}
        if(x < 0) {Putchar('-');x = -x;}
        while(x) {
            dec[++len] = x%10;
            x /= 10;
        }
        while(len) Putchar(dec[len--]+'0');
    }

    void write_string(const string &s) {
        for(int i = 0 ;i < s.size() ; ++i)
            Putchar(s[i]);
    }
}
void read(string &s) {
    if(system_const == 0) {
        using namespace fast_IO;
        read_string(s);
    }
    else cin >> s;
}
template<class T> void read(T &x) {
    if(system_const == 0) {
        using namespace fast_IO;
        read_number(x);
    }
    else cin >> x;
}
void write(const string &s) {
    if(system_const == 0) {
        fast_IO::write_string(s);
    }
    else cout << s;
}
template<class T> void write(T &x) {
    if(system_const == 0) {
        fast_IO::write_number(x);
    }
    else cout << x;
}
void writeln(const string &s) {
    write(s);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar('\n');
    }
    else cout << endl;
}
template<class T> void writeln(T x) {
    write(x);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar('\n');
    }
    else cout << '\n';
}
void writesp(const string &s) {
    write(s);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar(' ');
    }
    else cout << ' ';
}

template<class T> void writesp(T x) {
    write(x);
    if(system_const == 0) {
        using namespace fast_IO;
        Putchar(' ');
    }
    else cout << ' ';
}
void set_program_type(int t = 0) {
    system_const = t;
    if(t) {
        ios::sync_with_stdio(0);
        cin.tie(0);cout.tie(0);
    }
}
void finish_program(int t = 0) {
    if(!t) fast_IO::Flush();
}

void init_all(int t = 0,string s = "output") {
#ifdef LOCAL
    if ((t >> 1) & 1) freopen("input", "r", stdin);
    if ((t >> 2) & 1) freopen(s.c_str(), "w", stdout);
#endif
}

template <int MOD=998244353, class T = int> struct Modular {
    T value;
    static const T MOD_value = MOD;

    Modular(T v = 0) { value = v % MOD; if (value < 0) value += MOD;}
    Modular(T a, T b) : value(0){ *this += a; *this /= b;}

    Modular& operator+=(Modular const& b) {value += b.value; if (value >= MOD) value -= MOD; return *this;}
    Modular& operator-=(Modular const& b) {value -= b.value; if (value < 0) value += MOD;return *this;}
    Modular& operator*=(Modular const& b) {value = (long long)value * b.value % MOD;return *this;}

    friend Modular mexp(Modular a, long long e) {
        Modular res = 1; while (e) { if (e&1) res *= a; a *= a; e >>= 1; }
        return res;
    }
    friend Modular inverse(Modular a) { return mexp(a, MOD - 2); }

    Modular& operator/=(Modular const& b) { return *this *= inverse(b); }
    friend Modular operator+(Modular a, Modular const &b) { return a += b; }
    friend Modular operator-(Modular a, Modular const &b) { return a -= b; }
    friend Modular operator-(Modular const &a) { return 0 - a; }
    friend Modular operator*(Modular a, Modular const &b) { return a *= b; }
    friend Modular operator/(Modular a, Modular const &b) { return a /= b; }
    friend std::ostream& operator<<(std::ostream& os, Modular const& a) {return os << a.value;}
    friend bool operator==(Modular const& a, Modular const& b) {return a.value == b.value;}
    friend bool operator!=(Modular const& a, Modular const& b) {return a.value != b.value;}

};



int pre_ask_time;
void show_time() {
    int now = clock();
    cout << now-pre_ask_time << endl;
    pre_ask_time = now;
}

template<class T> void cmin(T &x,const T&y) {if(x > y) x = y;}
template<class T> void cmax(T &x,const T&y) {if(x < y) x = y;}

struct Vector{
    LL x,y;
    Vector(LL x = 0,LL y = 0):x(x),y(y){}
    friend LL operator *(const Vector &A,const Vector &B) {return A.x*B.x+A.y*B.y;}
    friend Vector operator - (const Vector &A,const Vector &B) {return Vector(B.x-A.x,B.y-A.y);}
    friend LL operator /(const Vector &A,const Vector &B) {return A.x*B.y-A.y*B.x;}
};

const int N = 2e5+19;
LL A[N],B[N],C[N];
LL ta[N],tb[N];
Vector p[N];
vector<int> stk;
int n,pos;
double ans[N];

void push(int x) {
    while(stk.size() > 1) {
        int a = stk.back(),b = stk[stk.size()-2];
        if((p[x]-p[b])/(p[a]-p[b]) > 0) break;
        else stk.pop_back();
    }
    stk.push_back(x);
}

void solve() {
    read(n);
    forn(i,n) read(ta[i]);
    forn(i,n) read(tb[i]);
    LL mn = -1;
    forn(i,n) if(ta[i] > mn) {
        mn = ta[i];
        pos = i;
    }
    for(int i = 0 ; i <= n ; ++i) {
        A[i] = ta[(i+pos)%n];
        B[i] = tb[(i+pos)%n];
    }

    C[0] = C[1] = 0;
    for(int i = 1 ; i < n ; ++i)
        C[i+1] = 2*C[i]-C[i-1]+2*B[i];

    for(int i = 0 ; i <= n ; ++i)
        p[i] = Vector(i,A[i]-C[i]);

    stk.push_back(0);
    for(int i = 1 ; i <= n ; ++i) push(i);
    for(int i = 1 ; i < stk.size() ; ++i) {
        int x = stk[i-1],y = stk[i];
        LL f = A[x]-C[x];
        LL d = A[y]-C[y]-f,l = (y-x);
        for(int j = x+1 ; j <= y ; ++j)
            ans[j] += f + (double) (j - x) / l * d + C[j];
    }
    double sum = 0;
    rep(i,1,n) sum += ans[i];
    printf("%.12f\n",sum/n);
}

signed main() {
    //srand((int)time(0));
    pre_ask_time = clock();
    init_all(3);

    //init();
    set_program_type(0);
    int T = 1;
    //read(T);
    //cin >> T;
    //scanf("%d",&T);
    rep(i,1,T) {
        //printf("Case %d:\n",i);
        solve();
    }

    finish_program(0);

    return 0;
}


Measured memory_bytes: 16704