1 #include<cstdio>
2 #include<iostream>
3 #include<cmath>
4 #include<cstring>
5 #include<algorithm>
6 using namespace std;
7 char ch;
8 bool ok;
9 void read(int &x){
10 for (ok=0,ch=getchar();!isdigit(ch);ch=getchar()) if (ch==‘-‘) ok=1;
11 for (x=0;isdigit(ch);x=x*10+ch-‘0‘,ch=getchar());
12 if (ok) x=-x;
13 }
14 void read(double &x){
15 for (ok=0,ch=getchar();!isdigit(ch);ch=getchar()) if (ch==‘-‘) ok=1;
16 for (x=0;isdigit(ch);x=x*10+ch-‘0‘,ch=getchar());
17 if (ok) x=-x;
18 }
19 const int maxn=305;
20 const double eps=1E-8;
21 int n;
22 double x[maxn],y[maxn],l,m,r,lim;
23 double getrand(){return rand()%1000000/1000000.0;}
24 double cross(double x,double y,double xx,double yy){return x*yy-xx*y;}
25 bool check(double pos,double h){
26 for (int i=2;i<=n;i++) if (cross(x[i-1]-pos,y[i-1]-h,x[i]-pos,y[i]-h)<0) return false;
27 return true;
28 }
29 double get_h(double pos){
30 for (int i=2;i<=n;i++) if (x[i-1]<=pos&&pos<=x[i]) return y[i-1]+(y[i]-y[i-1])/(x[i]-x[i-1])*(pos-x[i-1]);
31 return -1E12;
32 }
33 double calc(double pos){
34 l=get_h(pos),r=1E12;
35 while (r-l>eps){
36 m=(l+r)/2;
37 if (check(pos,m)) r=m; else l=m;
38 }
39 return l-get_h(pos);
40 }
41 void sa(){
42 double now=x[1]+getrand()*lim,nxt,t1=calc(now),t2;
43 for (double T=lim;T>0.000001;T*=0.996){
44 double dx=T*(getrand()*2-1);
45 nxt=now+dx;
46 t2=calc(nxt);
47 if (exp((t1-t2)/T)>getrand()) now=nxt,t1=t2;
48 }
49 printf("%.3lf\n",t1);
50 }
51 int main(){
52 srand(19990617);
53 read(n);
54 for (int i=1;i<=n;i++) read(x[i]);
55 for (int i=1;i<=n;i++) read(y[i]);
56 lim=x[n]-x[1],sa();
57 return 0;
58 }