#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair< ll, ll >;

using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

double m[50000];

int main() {
    int N;
    cin >> N;
    vector<double> t, v;
    vin(t, N);
    vin(v, N);
    rep(i, 50000) {
        m[i] = 1e8;
    }
    int sum = 0;
    rep(i, N) {
        t[i] *= 2;
        for (int j = sum; j <= sum + t[i]; ++j) {
            m[j] = min(m[j], v[i]);
        }
        sum += t[i];
    }
    m[0] = m[sum] = 0;
    rep(i, sum) {
        m[i + 1] = min(m[i + 1], m[i] + 0.5);
    }
    for (int i = sum - 1; i >= 0; --i) {
        m[i] = min(m[i], m[i + 1] + 0.5);
    }
    double S = 0;
    rep(i, sum) {
        S += m[i] + m[i + 1];
    }
    printf("%.12lf\n", (S / 2.0) / 2.0);
    return 0;
}
