#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<queue>
#include<map>
#include<vector>
#include<set>
#define il inline
#define re register
#define linf 1e15
using namespace std;
const int N=100001;
typedef double db;
int n,m,L,R,p;
db ans=1e60;
struct P{db x,y;} a[N],c[N],t,tt;
struct line{P a,b;db slop;} l[N],q[N];
il P operator-(P a,P b){
return (P){a.x-b.x,a.y-b.y};
}
il db operator*(P a,P b){
return a.x*b.y-a.y*b.x;
}
il bool cmp(line a,line b){
if(a.slop!=b.slop) return a.slop<b.slop;
return (a.b-a.a)*(b.b-a.a)>0;
}
il P inter(line a,line b){
double k1,k2,t;
k1=(b.b-a.a)*(a.b-a.a);
k2=(a.b-a.a)*(b.a-a.a);
t=k1/(k1+k2);P ans;
ans.x=b.b.x+(b.a.x-b.b.x)*t;
ans.y=b.b.y+(b.a.y-b.b.y)*t;
return ans;
}
il bool jud(line a,line b,line t){
P p=inter(a,b);
return (p-t.a)*(t.b-t.a)>0;
}
il void print(P a){
printf("(%lf,%lf)\n",a.x,a.y);
}
int main(){
scanf("%d",&n);m=n-1;
for(int i=1;i<=n;i++) scanf("%lf",&a[i].x);
for(int i=1;i<=n;i++) scanf("%lf",&a[i].y);
for(int i=1;i<n;i++){
l[i].a=a[i];
l[i].b=a[i+1];
}
l[++m]=(line){(P){a[1].x,1e7},a[1]};
l[++m]=(line){a[n],(P){a[n].x,1e7}};
for(int i=1;i<=m;i++)
l[i].slop=atan2(l[i].b.y-l[i].a.y,l[i].b.x-l[i].a.x);
sort(l+1,l+m+1,cmp);
L=1;R=2;
q[1]=l[1];q[2]=l[2];
for(int i=3;i<=m;i++){
while(L<R&&jud(q[R-1],q[R],l[i])) R--;
while(L<R&&jud(q[L],q[L+1],l[i])) L++;
q[++R]=l[i];
}
while(L<R&&jud(q[R-1],q[R],q[L])) R--;
while(L<R&&jud(q[L],q[L+1],q[R])) L++;
for(int i=L;i<R;i++)
c[++p]=inter(q[i],q[i+1]);
for(int i=1,j=1;i<=n;i++){
while(j<p&&(!(c[j].x<=a[i].x&&a[i].x<=c[j+1].x))) j++;
if(j<p){
tt=(P){a[i].x,-1};
t=inter((line){tt,a[i]},(line){c[j],c[j+1]});
ans=min(ans,t.y-a[i].y);
}
}
for(int i=1,j=1;i<=p;i++){
while(j<n&&(!(a[j].x<=c[i].x&&c[i].x<=a[j+1].x))) j++;
if(j<n){
tt=(P){c[i].x,-1};
t=inter((line){tt,c[i]},(line){a[j],a[j+1]});
ans=min(ans,c[i].y-t.y);
}
}
printf("%.3lf",ans);
return 0;
}