n = int(eval(input()))

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

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



dp = [[-1]*102 for _ in range(sum(T) + 1)]

dp[0][0] = 0



nt = 0

pt = T[0]

# i 秒から i+1 秒へ配る

delta = [-1,0,1]

for i in range(sum(T)):

    if pt == i:

        nt += 1

        pt += T[nt]

    for j in range(101):

        if j > V[nt] or dp[i][j] == -1:break

        for d in delta:

            nj = j + d

            if 0 <= nj <= V[nt]:

                if d != 0 or j == V[nt]:

                    dp[i+1][nj] = max(dp[i+1][nj], dp[i][j] + (j+nj)/2)

                else :

                    dp[i+1][nj] = max(dp[i+1][nj], dp[i][j] + j + 0.25)



print((dp[-1][0]))

n = int(eval(input()))

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

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

s = [0]*n

for i in range(n-1):

    s[i+1] = s[i] + T[i]

l = (s[-1]+T[n-1])*2+1

ans = [1e100]*l



for i in range(l):

    ans[i] = min(ans[i],i/2)

    ans[l-i-1] = min(ans[i],i/2)



for j in range(n):

    for i in range(l):

        if i <= s[j]*2:

            ans[i] = min(ans[i], V[j]+(s[j]*2-i)/2)

        elif s[j]*2 <= i <= s[j]*2+T[j]*2:

            ans[i] = min(ans[i],V[j])

        else:

            ans[i] = min(ans[i],V[j]+(i-s[j]*2-T[j]*2)/2)

anser = 0

for i in range(l-1):

    anser += (ans[i]+ans[i+1])/4

print(anser)

n = int(eval(input()))
T = list(map(int, input().split()))
V = list(map(int, input().split()))
dp = [[-1] * 102 for _ in range(sum(T) + 1)]
dp[0][0] = 0
nt = 0
pt = T[0]
# i 秒から i+1 秒へ配る
delta = [-1, 0, 1]
for i in range(sum(T)):
    if pt == i:
        nt += 1
        pt += T[nt]
    for j in range(101):
        if j > V[nt] or dp[i][j] == -1:
            break
        for d in delta:
            nj = j + d
            if 0 <= nj <= V[nt]:
                if d != 0 or j == V[nt]:
                    dp[i + 1][nj] = max(dp[i + 1][nj], dp[i][j] + (j + nj) / 2)
                else:
                    dp[i + 1][nj] = max(dp[i + 1][nj], dp[i][j] + j + 0.25)
print((dp[-1][0]))

n = int(eval(input()))
T = list(map(int, input().split()))
V = list(map(int, input().split()))
s = [0] * n
for i in range(n - 1):
    s[i + 1] = s[i] + T[i]
l = (s[-1] + T[n - 1]) * 2 + 1
ans = [1e100] * l
for i in range(l):
    ans[i] = min(ans[i], i / 2)
    ans[l - i - 1] = min(ans[i], i / 2)
for j in range(n):
    for i in range(l):
        if i <= s[j] * 2:
            ans[i] = min(ans[i], V[j] + (s[j] * 2 - i) / 2)
        elif s[j] * 2 <= i <= s[j] * 2 + T[j] * 2:
            ans[i] = min(ans[i], V[j])
        else:
            ans[i] = min(ans[i], V[j] + (i - s[j] * 2 - T[j] * 2) / 2)
anser = 0
for i in range(l - 1):
    anser += (ans[i] + ans[i + 1]) / 4
print(anser)

-dp = [[-1] * 102 for _ in range(sum(T) + 1)] -dp[0][0] = 0 -nt = 0 -pt = T[0] -# i 秒から i+1 秒へ配る -delta = [-1, 0, 1] -for i in range(sum(T)): -    if pt == i: -        nt += 1 -        pt += T[nt] -    for j in range(101): -        if j > V[nt] or dp[i][j] == -1: -            break -        for d in delta: -            nj = j + d -            if 0 <= nj <= V[nt]: -                if d != 0 or j == V[nt]: -                    dp[i + 1][nj] = max(dp[i + 1][nj], dp[i][j] + (j + nj) / 2) -                else: -                    dp[i + 1][nj] = max(dp[i + 1][nj], dp[i][j] + j + 0.25) -print((dp[-1][0])) +s = [0] * n +for i in range(n - 1): +    s[i + 1] = s[i] + T[i] +l = (s[-1] + T[n - 1]) * 2 + 1 +ans = [1e100] * l +for i in range(l): +    ans[i] = min(ans[i], i / 2) +    ans[l - i - 1] = min(ans[i], i / 2) +for j in range(n): +    for i in range(l): +        if i <= s[j] * 2: +            ans[i] = min(ans[i], V[j] + (s[j] * 2 - i) / 2) +        elif s[j] * 2 <= i <= s[j] * 2 + T[j] * 2: +            ans[i] = min(ans[i], V[j]) +        else: +            ans[i] = min(ans[i], V[j] + (i - s[j] * 2 - T[j] * 2) / 2) +anser = 0 +for i in range(l - 1): +    anser += (ans[i] + ans[i + 1]) / 4 +print(anser)