import
    std.algorithm,
    std.array,
    std.conv,
    std.range,
    std.stdio,
    std.string;
 
void main()
{
    immutable n = readln.chomp.to!size_t;
    auto t = readln.chomp.split.map!(to!int).array;
    auto v = readln.chomp.split.map!(to!int).array;
 
    int pos;
    int[] start, end;
    foreach (ts; t)
    {
        start ~= pos;
        pos += ts;
        end ~= pos;
    }
 
    real result = 0;
    foreach (x2; 0..end[$-1]*2)
    {
        real x = x2 * 0.5;
        real xnext = x + 0.5;
        result += (velocity(x, start, end, v) + velocity(xnext, start, end, v)) / 4;
    }
    "%.2f".writefln(result);
}
 
auto velocity(real x, int[] start, int[] end, int[] v)
{
    return v.length.iota.map!(i => limit(x, start[i], end[i], v[i])).reduce!min
        .min(x).min(end[$-1]-x);
}
 
auto limit(real x, int start, int end, int v)
{
 
    if (x < start)
    {
        return v + (start - x);
    }
    if (end < x)
    {
        return v + (x - end);
    }
    return v;
}