#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int t[105];
double v[105];
double u[40005];
int main( void )
{
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  t[0] = 0;
  v[0] = 0;
  v[N+1] = 0;
  for( int i=1; i<=N; i++ ) cin >> t[i];
  for( int i=1; i<=N; i++ ) cin >> v[i];
  for( int i=1; i<=N; i++ ){
    t[i] += t[i-1];
  }
  for( int i=0; i<=t[N]*2; i++ ){
    u[i] = 0.5 * i;
  }
  for( int i=t[N]*2; i>=0; i-- ){
    u[i] = min( u[i], t[N] - i*0.5 );
  }
  for( int i=1; i<=N; i++ ){
    for( int j=0; j<t[i-1]*2; j++ ){
      u[j] = min( u[j], v[i] + t[i-1] - j*0.5 );
    }
    for( int j=t[i-1]*2; j<=t[i]*2; j++ ){
      u[j] = min( u[j], v[i] );
    }
    for( int j=t[i]*2+1; j<=t[N]*2; j++ ){
      u[j] = min( u[j], v[i] + j*0.5 - t[i] );
    }
  }
  double ret = 0;
  for( int i=1; i<=t[N]*2; i++ ){
    ret += (u[i-1] + u[i]) / 4;
  }
  printf( "%.12f\n", ret );
}