N = int(eval(input()))

ts = list(map(int,input().split()))

vs = list(map(int,input().split()))



maxv = [0]

for v,t in zip(vs,ts):

    maxv[-1] = min(maxv[-1], v)

    for ti in range(t*2):

        maxv.append(v)

T = len(maxv)



for i in range(T-1):

    maxv[i+1] = min(maxv[i+1], maxv[i] + 0.5)



maxv[-1] = 0

for i in reversed(list(range(T-1))):

    maxv[i] = min(maxv[i], maxv[i+1] + 0.5)



ans = 0.0

for i in range(T-1):

    ans += (maxv[i] + maxv[i+1]) * 0.25

print(ans)

N = int(eval(input()))

T = list([int(x)*2 for x in input().split()])

V = list([int(x)*2 for x in input().split()])



sumt = sum(T)

maxv = [min(i, sumt-i) for i in range(sumt+1)]



ct = 0

for t,v in zip(T,V):

    for i in range(ct,ct+t+1):

        maxv[i] = min(maxv[i], v)

    ct += t



for i in range(sumt):

    maxv[i+1] = min(maxv[i+1], maxv[i] + 1)

for i in reversed(list(range(sumt))):

    maxv[i] = min(maxv[i], maxv[i+1] + 1)



print((sum(maxv) / 4))
N = int(eval(input()))
ts = list(map(int, input().split()))
vs = list(map(int, input().split()))
maxv = [0]
for v, t in zip(vs, ts):
    maxv[-1] = min(maxv[-1], v)
    for ti in range(t * 2):
        maxv.append(v)
T = len(maxv)
for i in range(T - 1):
    maxv[i + 1] = min(maxv[i + 1], maxv[i] + 0.5)
maxv[-1] = 0
for i in reversed(list(range(T - 1))):
    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5)
ans = 0.0
for i in range(T - 1):
    ans += (maxv[i] + maxv[i + 1]) * 0.25
print(ans)

N = int(eval(input()))
T = list([int(x) * 2 for x in input().split()])
V = list([int(x) * 2 for x in input().split()])
sumt = sum(T)
maxv = [min(i, sumt - i) for i in range(sumt + 1)]
ct = 0
for t, v in zip(T, V):
    for i in range(ct, ct + t + 1):
        maxv[i] = min(maxv[i], v)
    ct += t
for i in range(sumt):
    maxv[i + 1] = min(maxv[i + 1], maxv[i] + 1)
for i in reversed(list(range(sumt))):
    maxv[i] = min(maxv[i], maxv[i + 1] + 1)
print((sum(maxv) / 4))

-ts = list(map(int, input().split())) -vs = list(map(int, input().split())) -maxv = [0] -for v, t in zip(vs, ts): -    maxv[-1] = min(maxv[-1], v) -    for ti in range(t * 2): -        maxv.append(v) -T = len(maxv) -for i in range(T - 1): -    maxv[i + 1] = min(maxv[i + 1], maxv[i] + 0.5) -maxv[-1] = 0 -for i in reversed(list(range(T - 1))): -    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5) -ans = 0.0 -for i in range(T - 1): -    ans += (maxv[i] + maxv[i + 1]) * 0.25 -print(ans) +T = list([int(x) * 2 for x in input().split()]) +V = list([int(x) * 2 for x in input().split()]) +sumt = sum(T) +maxv = [min(i, sumt - i) for i in range(sumt + 1)] +ct = 0 +for t, v in zip(T, V): +    for i in range(ct, ct + t + 1): +        maxv[i] = min(maxv[i], v) +    ct += t +for i in range(sumt): +    maxv[i + 1] = min(maxv[i + 1], maxv[i] + 1) +for i in reversed(list(range(sumt))): +    maxv[i] = min(maxv[i], maxv[i + 1] + 1) +print((sum(maxv) / 4))