import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

alias TV = Tuple!(int, "t", int, "v");

int[200*100*2+1] GP;

void main()
{
    auto N = readln.chomp.to!int;
    auto ts = readln.split.to!(int[]).map!"a * 2".array;
    auto vs = readln.split.to!(int[]).map!"a * 2".array;

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

    int i = 1;
    foreach (j, t; ts) {
        while (i <= t) {
            GP[i++] = vs[j];
        }
    }

    foreach (j, t; ts) {
        auto x = j == N-1 ? 0 : vs[j+1];
        foreach_reverse (k; 0..t+1) {
            if (GP[k] <= x) break;
            GP[k] = x++;
        }
    }

    i = 0;
    double r = 0;
    foreach (j; 0..ts[$-1]+1) {
        i = min(GP[j], i);
        r += i++;
    }

    writeln(r / 4.0);
}