#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

vector<int> vt;
int t[101],v[101];
double c_area(double h1,double h2,double w){
    return 0.5*(h1+h2)*w;
}
int main(){
    int n,tt;
    cin>>n;
    cin>>t[0];
    FOR(i,1,n){
        cin>>tt;
        t[i]=tt+t[i-1];
    }
    rep(i,n) cin>>v[i];
    double cv=0.0,ans=0.0,pre=0.0;
    int ct=0;
    v[n]=0;
    for(double i=0.5;i<=t[n-1];i+=0.5){
        cv+=0.5;
        if(i>t[ct]) ++ct;
        rep(j,n){
            if(i<=t[j]) cv=min(cv,v[j+1]+(t[j]-i));
        }
        cv=min(cv,(double)v[ct]);
        ans+=c_area(pre,cv,0.5);
        pre=cv;
    }
    cout<<fixed<<setprecision(10)<<ans<<endl;
    return 0;
}