#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  int t[101];
  int v[102];
  for (int i = 0; i < n; i++){
    scanf("%d", &t[i]);
  }
  for (int i = 0; i < n; i++){
    scanf("%d", &v[i]);
  }
  v[n] = 0;
  float g[60001];
  g[0] = 0;
  int tt = 0;
  for (int i = 0; i < n; i++){
    int u = tt + t[i] * 2;
    for (; tt < u; tt++){
      if (g[tt] + 0.5 <= v[i]) {
        g[tt+1] = g[tt] + 0.5;
      }
      else g[tt+1] = g[tt];
    }
    if (g[tt] > v[i+1]) {
      int p = tt;
      g[p] = v[i+1];
      while (true) {
        if (g[p-1] != g[p] + 0.5){
          g[p-1] = g[p] + 0.5;
          p--;
        } else break;
      }
    }
  }

  float ans = 0;
  for (int i = 0; i < tt; i++){
    ans += (g[i] + g[i+1]);
  }

  printf("%.8f\n", ans / 4);

  return 0;
}
