#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n;
long long a[200020],na[200020],c[200020],w[200020],ans;
int b[200020],nb[200020];
int st[200020],tp;
bool check(int x,int y,int z){return (w[z]-w[y])*(y-x)>=(w[y]-w[x])*(z-y);}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%lld",&a[i]);
	for(int i=1;i<=n;++i)scanf("%d",&b[i]);
	int p=1;
	for(int i=2;i<=n;++i)if(a[i]>a[p])p=i;
	for(int i=0,j=p;i<=n;++i,(++j)>n?j-=n:0)na[i]=a[j],nb[i]=b[j];
	for(int i=0;i<=n;++i)a[i]=na[i],b[i]=nb[i];
	// for(int i=0;i<=n;++i)printf("%lld ",a[i]);printf("\n");
	// for(int i=0;i<=n;++i)printf("%d ",b[i]);printf("\n");
	c[1]=0;
	for(int i=1;i<n;++i)c[i+1]=2*(c[i]+b[i])-c[i-1];
	// for(int i=0;i<=n;++i)printf("%lld ",c[i]);printf("\n");
	for(int i=0;i<=n;++i)
	{
		w[i]=a[i]-c[i];
		while(tp>=2&&check(st[tp-1],st[tp],i))--tp;
		st[++tp]=i;
	}
	// for(int i=1;i<=tp;++i)printf("%d %lld\n",st[i],w[st[i]]);
	for(int i=1;i<tp;++i)ans+=2*w[st[i]]*(st[i+1]-st[i])+(st[i+1]-st[i]+1)*(w[st[i+1]]-w[st[i]]);
	for(int i=1;i<=n;++i)ans+=2*c[i];
	printf("%.12lf",1.0*ans/n/2);
	return 0;
}