#include<cstdio>
#define RI register int
#define CI const int&
#define CL const LL&
using namespace std;
typedef long long LL;
const int N=200005;
struct point
{
	LL x,y;
	inline point(CL X=0,CL Y=0) { x=X; y=Y; }
	friend inline point operator - (const point& A,const point& B)
	{
		return point(A.x-B.x,A.y-B.y);
	}
}p[N],stk[N]; LL n,m,a[N],b[N],c[N],pos,ans;
inline LL Cross(const point& A,const point& B)
{
	return A.x*B.y-A.y*B.x;
}
inline int Convex_Hull(point *p,CI n)
{
	RI i,top=0; for (i=1;i<=n;++i)
	{
		while (top>1&&Cross(stk[top]-stk[top-1],p[i]-stk[top])>0) --top;
		stk[++top]=p[i];
	}
	for (i=1;i<=top;++i) p[i]=stk[i]; return top;
}
int main()
{
	RI i; for (scanf("%lld",&n),i=1;i<=n;++i) scanf("%lld",&a[i]);
	for (i=1;i<=n;++i) scanf("%lld",&b[i]),a[i]>a[pos]&&(pos=i);
	for (i=pos;i<=n;++i) c[++m]=a[i]; for (i=1;i<=pos;++i) c[++m]=a[i];
	for (i=1;i<=m;++i) a[i]=c[i]; m=0;
	for (i=pos;i<=n;++i) c[++m]=b[i]; for (i=1;i<=pos;++i) c[++m]=b[i];
	for (i=1;i<=m;++i) b[i]=c[i]; c[1]=0; ++n;
	for (i=2;i<=n;++i) c[i]=2LL*(b[i-1]+c[i-1])-c[i-2];
	for (i=1;i<=n;++i) p[i]=point(i,a[i]-c[i]);
	for (m=n,n=Convex_Hull(p,n),i=2;i<=n;++i)
	ans+=(p[i].x-p[i-1].x)*(p[i].y+p[i-1].y);
	for (ans+=p[1].y+p[n].y,i=1;i<=m;++i) ans+=2LL*c[i];
	return ans-=2LL*a[1],printf("%.12lf",0.5*ans/(m-1)),0;
}