#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#include<map>
#include<queue>
#include<set>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
int n,maxv[105],l[105],r[105],T,tt;
double ans,las,now;
inline double v(double t){
	double ans=1e50,te;
	fo(i,0,n+1){
		te=maxv[i];
		if (t<l[i]) te=maxv[i]+l[i]-t;
		if (t>r[i]) te=maxv[i]+t-r[i];
		if (te<ans) ans=te;
	}
	return ans;
}
int main(){
	scanf("%d",&n);
	fo(i,1,n){
		scanf("%d",&tt);
		l[i]=r[i-1];
		r[i]=l[i]+tt;
	}
	r[n+1]=l[n+1]=r[n];
	fo(i,1,n) scanf("%d",&maxv[i]);
	las=0;
	for(double t=0.5;t<=r[n];t+=0.5){
		now=v(t);
		ans+=0.25*(las+now);
		las=now;
	}
	printf("%.12f\n",ans);
	return 0;
}