#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<bitset>
#define sqr(x) ((x)*(x))
#define fz1(i,n) for ((i)=1;(i)<=(n);(i)++)
#define fd1(i,n) for ((i)=(n);(i)>=1;(i)--)
#define fz0g(i,n) for ((i)=0;(i)<=(n);(i)++)
#define fd0g(i,n) for ((i)=(n);(i)>=0;(i)--)
#define fz0k(i,n) for ((i)=0;(i)<(n);(i)++)
#define fd0k(i,n) for ((i)=(long long)((n)-1);(i)>=0;(i)--)
#define fz(i,x,y) for ((i)=(x);(i)<=(y);(i)++)
#define fd(i,y,x) for ((i)=(y);(i)>=(x);(i)--)
#define fzin fz1(i,n)
#define fzim fz1(i,m)
#define fzjn fz1(j,n)
#define fzjm fz1(j,m)
#define ff(c,itr) for (__typeof((c).begin()) itr=(c).begin();itr!=(c).end();++itr)
#define rdst(st,len){static char ss[len];scanf(" %s",ss);(st)=ss;}
#define inc(x,y) {x+=(y);if(x>=mod)x-=mod;}
#define dec(x,y) {x-=(y);if(x<0)x+=mod;}
#define spln(i,n) (i==n?'\n':' ')
#define fac_init(n){fac[0]=fac[1]=inv[1]=fi[0]=fi[1]=1;fz(i,2,n){fac[i]=1ll*fac[i-1]*i%mod;inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;fi[i]=1ll*fi[i-1]*inv[i]%mod;}}
using namespace std;
inline void read(int &x)
{
	char c;int f=1;
	while(!isdigit(c=getchar()))if(c=='-')f=-1;
	x=(c&15);while(isdigit(c=getchar()))x=(x<<1)+(x<<3)+(c&15);
	x*=f;
}
inline void read(long long &x)
{
	char c;int f=1;
	while(!isdigit(c=getchar()))if(c=='-')f=-1;
	x=(c&15);while(isdigit(c=getchar()))x=(x<<1)+(x<<3)+(c&15);
	x*=f;
}
int n,m,i,j;
long long a[200005],b[200005],tmp[200005],c[200005],y[200005],ans;
int stk[200005],tp;
long long crs(long long x1,long long y1,long long x2,long long y2)
{
	return x1*y2-y1*x2;
}
int main()
{
	read(n);
	fz1(i,n){
		read(a[i]);
	}
	fz1(i,n){
		read(b[i]);
	}
	int mx=0;
	fz1(i,n){
		if(a[i]>a[mx]) mx=i;
	}
	fz0k(i,n){
		tmp[i]=a[(mx+i-1+n)%n+1];
	}
	fz0g(i,n){
		a[i]=tmp[i%n];
	}
	fz0k(i,n){
		tmp[i]=b[(mx+i-1+n)%n+1];
	}
	fz0g(i,n){
		b[i]=tmp[i%n];
	}
	fz(i,2,n){
		c[i]=2*(c[i-1]+b[i-1])-c[i-2];
	}
	fz0g(i,n){
		y[i]=a[i]-c[i];
	}
	stk[tp=1]=0;
	fz1(i,n){
		while(tp>1&&crs(stk[tp]-stk[tp-1],y[stk[tp]]-y[stk[tp-1]],i-stk[tp-1],y[i]-y[stk[tp-1]])>=0){
			tp--;
		}
		stk[++tp]=i;
	}
	fz1(i,tp-1){
		long long dx=stk[i+1]-stk[i];
		ans+=(dx+1)*y[stk[i]]+(dx-1)*y[stk[i+1]];
	}
	fz0k(i,n){
		ans+=2*c[i];
	}
	printf("%.10f\n",ans/2.0/n);
	return 0;
}