n=int(eval(input()))

t=[int(i) for i in input().split()]

v=[int(i) for i in input().split()]

S=[0 for i in range(n)]

S1=[0 for i in range(n)]

S2=[0 for i in range(n)]

vel=[0 for i in range(n)]



dt=[0 for i in range(n)]

v0=[0 for i in range(n)]

ve=[0 for i in range(n)]

ok=0







for i in range(n):

    if n ==1:

        dt[0]=t[0]

    elif i==n-1:

        v0[i]=ve[i-1]

        ve[i]=0

        dt[i]=t[i]

    else:

        v0[i]=ve[i-1]

        dt[i]=t[i]

        ve[i]=min(v[i+1],v[i],v0[i]+dt[i])



#print(dt)

#print(v0)

#print(ve)



while ok==0:

    for i in range(n-1):

#        if  abs((ve[i]-ve[i+1])/dt[i+1]) >1:

        if  abs((ve[i+1]-v0[i+1])/dt[i+1]) >1:

                ve[i]=ve[i]-1

                v0[i+1]=v0[i+1]-1

#                v0[i]=v0[i]-1

#                print("dt",dt)

#                print("v0",v0)

#                print("ve",ve)

                break

    else:

        ok=1





#print(dt)

#print(v0)

#print(ve)





for i in range(n):



    ttt=0.5*(ve[i]+dt[i]-v0[i])

    vvv=ttt+v0[i]

    if vvv-v[i]>=0:

        S[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt) - (ttt-v[i]+v0[i])*(vvv-v[i]) 

        S1[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt)

        S2[i]=(ttt-v[i]+v0[i])*(vvv-v[i]) 

    else:

        S[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt)

        S1[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt)

        S2[i]=0



print((sum(S)))



#標準入力

n=int(eval(input()))

t=[int(i) for i in input().split()]

v=[int(i) for i in input().split()]



#n個の区間について

dt=[0 for i in range(n)] #区間の時間

v0=[0 for i in range(n)] #各区間の最初の速度

ve=[0 for i in range(n)] #各区間の最後の速度

S=[0 for i in range(n)] #各区間に走った距離（v-tグラフの面積）

ok=0 #ok牧場　後でフラグに使う



#dt, v0, veを格納(v0, veは後で題意を満たすように調整する）----------



for i in range(n):

    if n ==1:

        dt[0]=t[0]

    elif i==n-1:

        v0[i]=ve[i-1]

        ve[i]=0

        dt[i]=t[i]

    else:

        v0[i]=ve[i-1]

        dt[i]=t[i]

        ve[i]=min(v[i+1],v[i],v0[i]+dt[i])



#α=(ve-v0)/dtが±1以下になるように調整-----------------------------------------



while ok==0:

    for i in range(n-1):

        if  abs((ve[i+1]-v0[i+1])/dt[i+1]) >1:

                ve[i]=ve[i]-1

                v0[i+1]=v0[i+1]-1



                break

    else:

        ok=1

#------------------------------------------------------------------------------------------------



#各区間に関して、走った距離（v-tグラフの面積）を計算---------------------

for i in range(n):



    ttt=0.5*(ve[i]+dt[i]-v0[i])

    vvv=ttt+v0[i]

    if vvv-v[i]>=0:

        S[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt) - (ttt-v[i]+v0[i])*(vvv-v[i]) 



    else:

        S[i]=0.5*(v0[i]+vvv)*ttt + 0.5*(ve[i]+vvv)*(dt[i]-ttt)



#------------------------------------------------------------------------------------------------

print((sum(S))) #各区間の走った距離の総和（答え）を出力
n = int(eval(input()))
t = [int(i) for i in input().split()]
v = [int(i) for i in input().split()]
S = [0 for i in range(n)]
S1 = [0 for i in range(n)]
S2 = [0 for i in range(n)]
vel = [0 for i in range(n)]
dt = [0 for i in range(n)]
v0 = [0 for i in range(n)]
ve = [0 for i in range(n)]
ok = 0
for i in range(n):
    if n == 1:
        dt[0] = t[0]
    elif i == n - 1:
        v0[i] = ve[i - 1]
        ve[i] = 0
        dt[i] = t[i]
    else:
        v0[i] = ve[i - 1]
        dt[i] = t[i]
        ve[i] = min(v[i + 1], v[i], v0[i] + dt[i])
# print(dt)
# print(v0)
# print(ve)
while ok == 0:
    for i in range(n - 1):
        #        if  abs((ve[i]-ve[i+1])/dt[i+1]) >1:
        if abs((ve[i + 1] - v0[i + 1]) / dt[i + 1]) > 1:
            ve[i] = ve[i] - 1
            v0[i + 1] = v0[i + 1] - 1
            #                v0[i]=v0[i]-1
            #                print("dt",dt)
            #                print("v0",v0)
            #                print("ve",ve)
            break
    else:
        ok = 1
# print(dt)
# print(v0)
# print(ve)
for i in range(n):
    ttt = 0.5 * (ve[i] + dt[i] - v0[i])
    vvv = ttt + v0[i]
    if vvv - v[i] >= 0:
        S[i] = (
            0.5 * (v0[i] + vvv) * ttt
            + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
            - (ttt - v[i] + v0[i]) * (vvv - v[i])
        )
        S1[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
        S2[i] = (ttt - v[i] + v0[i]) * (vvv - v[i])
    else:
        S[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
        S1[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
        S2[i] = 0
print((sum(S)))

# 標準入力
n = int(eval(input()))
t = [int(i) for i in input().split()]
v = [int(i) for i in input().split()]
# n個の区間について
dt = [0 for i in range(n)]  # 区間の時間
v0 = [0 for i in range(n)]  # 各区間の最初の速度
ve = [0 for i in range(n)]  # 各区間の最後の速度
S = [0 for i in range(n)]  # 各区間に走った距離（v-tグラフの面積）
ok = 0  # ok牧場　後でフラグに使う
# dt, v0, veを格納(v0, veは後で題意を満たすように調整する）----------
for i in range(n):
    if n == 1:
        dt[0] = t[0]
    elif i == n - 1:
        v0[i] = ve[i - 1]
        ve[i] = 0
        dt[i] = t[i]
    else:
        v0[i] = ve[i - 1]
        dt[i] = t[i]
        ve[i] = min(v[i + 1], v[i], v0[i] + dt[i])
# α=(ve-v0)/dtが±1以下になるように調整-----------------------------------------
while ok == 0:
    for i in range(n - 1):
        if abs((ve[i + 1] - v0[i + 1]) / dt[i + 1]) > 1:
            ve[i] = ve[i] - 1
            v0[i + 1] = v0[i + 1] - 1
            break
    else:
        ok = 1
# ------------------------------------------------------------------------------------------------
# 各区間に関して、走った距離（v-tグラフの面積）を計算---------------------
for i in range(n):
    ttt = 0.5 * (ve[i] + dt[i] - v0[i])
    vvv = ttt + v0[i]
    if vvv - v[i] >= 0:
        S[i] = (
            0.5 * (v0[i] + vvv) * ttt
            + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
            - (ttt - v[i] + v0[i]) * (vvv - v[i])
        )
    else:
        S[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt)
# ------------------------------------------------------------------------------------------------
print((sum(S)))  # 各区間の走った距離の総和（答え）を出力

+# 標準入力 -S = [0 for i in range(n)] -S1 = [0 for i in range(n)] -S2 = [0 for i in range(n)] -vel = [0 for i in range(n)] -dt = [0 for i in range(n)] -v0 = [0 for i in range(n)] -ve = [0 for i in range(n)] -ok = 0 +# n個の区間について +dt = [0 for i in range(n)]  # 区間の時間 +v0 = [0 for i in range(n)]  # 各区間の最初の速度 +ve = [0 for i in range(n)]  # 各区間の最後の速度 +S = [0 for i in range(n)]  # 各区間に走った距離（v-tグラフの面積） +ok = 0  # ok牧場　後でフラグに使う -# print(dt) -# print(v0) -# print(ve) -        #        if  abs((ve[i]-ve[i+1])/dt[i+1]) >1: -            #                v0[i]=v0[i]-1 -            #                print("dt",dt) -            #                print("v0",v0) -            #                print("ve",ve) -# print(dt) -# print(v0) -# print(ve) -        S1[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt) -        S2[i] = (ttt - v[i] + v0[i]) * (vvv - v[i]) -        S1[i] = 0.5 * (v0[i] + vvv) * ttt + 0.5 * (ve[i] + vvv) * (dt[i] - ttt) -        S2[i] = 0 -print((sum(S))) +print((sum(S)))  # 各区間の走った距離の総和（答え）を出力