void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; rd(n);
  auto ts=readln.split.to!(int[]);
  auto vs=readln.split.to!(int[]);

  foreach(i; 1..n) ts[i]+=ts[i-1];

  int T=100*200*2+1, V=100*2+1;
  auto dp=new double[][](T, V);
  foreach(i; 0..T)foreach(j; 0..V) dp[i][j]=-1;
  dp[0][0]=0;
  int t=0;
  foreach(i; 0..n){
    do{
      for(int v=0; v<=vs[i]*2; v++)if(dp[t][v]>=0){
        chmax(dp[t+1][v], dp[t][v]+v);
        if(v+1<=vs[i]*2) chmax(dp[t+1][v+1], dp[t][v]+(v+(v+1))/2.0);
        if(v-1>=0) chmax(dp[t+1][v-1], dp[t][v]+(v+(v-1))/2.0);
      }
    }while((++t)<ts[i]*2);
  }

  writefln("%.18f", dp[ts[$-1]*2][0]/4.0);
}

void chmax(T)(ref T l, T r){if(l<r)l=r;}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}
