# -*- coding: utf-8 -*-



"""

参考：http://ferin-tech.hatenablog.com/entry/2017/10/28/231616

・愚直に3重ループでシミュレーション

"""



N = int(eval(input()))

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

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

# 終点の処理をしやすくするため追加

tN.append(0)

vN.append(0)



dist = 0

speed = 0

for i in range(N):

    keep = True

    plus = True

    # 小数刻みのfor文

    for j in [0.5*x for x in range(tN[i]*2)]:

        # 現在の最大スピードに達した

        if speed == vN[i]:

            plus = False

        rest = tN[i] - j

        # 今より先で、下げきれなくなる状況がないか確認

        for k in range(i+1, N+1):

            if vN[k] < vN[i] and rest <= speed - vN[k]:

                keep = False

                plus = False

            rest += tN[k]

        # フラグの状況に合わせて加速or維持or減速

        if plus:

            # ここでの数値の加減は進み方が0.5刻みなので注意する

            dist += speed/2

            speed += 0.5

            dist += 0.125

        elif keep:

            dist += speed/2

        else:

            speed -= 0.5

            dist += speed/2

            dist += 0.125

print(dist)

# -*- coding: utf-8 -*-



import sys



def input(): return sys.stdin.readline().strip()

def list2d(a, b, c): return [[c] * b for i in range(a)]

def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1): return int(-(-x // y))

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes(): print('Yes')

def No(): print('No')

def YES(): print('YES')

def NO(): print('NO')

sys.setrecursionlimit(10 ** 9)

INF = 10 ** 18

MOD = 10 ** 9 + 7



N = INT()

# 0.5考慮のため*2、終了時0のため番兵

A = [a*2 for a in LIST()] + [1]

B = [b*2 for b in LIST()] + [0]



def check1(i, t):

    nxtt = cur

    for j in range(i+1, N+1):

        nxtt += A[j-1]

        dist = nxtt - t

        # 1つ先で+1の状態でいても大丈夫かどうか

        if spd + 2 - dist > B[j]:

            return False

    return True



def check2(i, t):

    nxtt = cur

    for j in range(i+1, N+1):

        nxtt += A[j-1]

        dist = nxtt - t

        # 1つ先で今と同じ(+-0)の状態でいても大丈夫かどうか

        if spd + 1 - dist > B[j]:

            return False

    return True



cur = spd = sm = 0

for i, a in enumerate(A[:N]):

    b = B[i]

    # 各時点tにおいて加速、維持が可能かどうか確認

    for t in range(cur, cur+a):

        # 加速OK

        if spd + 1 <= b and check1(i, t):

            # この瞬間の加算分は増減の半分にする

            sm += spd + 0.5

            spd += 1

        # 維持OK

        elif spd <= b and check2(i, t):

            sm += spd

        # 減速必須

        else:

            sm += spd - 0.5

            spd -= 1

    cur += a

print((sm / 4))

# -*- coding: utf-8 -*-
"""
参考：http://ferin-tech.hatenablog.com/entry/2017/10/28/231616
・愚直に3重ループでシミュレーション
"""
N = int(eval(input()))
tN = list(map(int, input().split()))
vN = list(map(int, input().split()))
# 終点の処理をしやすくするため追加
tN.append(0)
vN.append(0)
dist = 0
speed = 0
for i in range(N):
    keep = True
    plus = True
    # 小数刻みのfor文
    for j in [0.5 * x for x in range(tN[i] * 2)]:
        # 現在の最大スピードに達した
        if speed == vN[i]:
            plus = False
        rest = tN[i] - j
        # 今より先で、下げきれなくなる状況がないか確認
        for k in range(i + 1, N + 1):
            if vN[k] < vN[i] and rest <= speed - vN[k]:
                keep = False
                plus = False
            rest += tN[k]
        # フラグの状況に合わせて加速or維持or減速
        if plus:
            # ここでの数値の加減は進み方が0.5刻みなので注意する
            dist += speed / 2
            speed += 0.5
            dist += 0.125
        elif keep:
            dist += speed / 2
        else:
            speed -= 0.5
            dist += speed / 2
            dist += 0.125
print(dist)

# -*- coding: utf-8 -*-
import sys


def input():
    return sys.stdin.readline().strip()


def list2d(a, b, c):
    return [[c] * b for i in range(a)]


def list3d(a, b, c, d):
    return [[[d] * c for j in range(b)] for i in range(a)]


def list4d(a, b, c, d, e):
    return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]


def ceil(x, y=1):
    return int(-(-x // y))


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST(N=None):
    return list(MAP()) if N is None else [INT() for i in range(N)]


def Yes():
    print("Yes")


def No():
    print("No")


def YES():
    print("YES")


def NO():
    print("NO")


sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7
N = INT()
# 0.5考慮のため*2、終了時0のため番兵
A = [a * 2 for a in LIST()] + [1]
B = [b * 2 for b in LIST()] + [0]


def check1(i, t):
    nxtt = cur
    for j in range(i + 1, N + 1):
        nxtt += A[j - 1]
        dist = nxtt - t
        # 1つ先で+1の状態でいても大丈夫かどうか
        if spd + 2 - dist > B[j]:
            return False
    return True


def check2(i, t):
    nxtt = cur
    for j in range(i + 1, N + 1):
        nxtt += A[j - 1]
        dist = nxtt - t
        # 1つ先で今と同じ(+-0)の状態でいても大丈夫かどうか
        if spd + 1 - dist > B[j]:
            return False
    return True


cur = spd = sm = 0
for i, a in enumerate(A[:N]):
    b = B[i]
    # 各時点tにおいて加速、維持が可能かどうか確認
    for t in range(cur, cur + a):
        # 加速OK
        if spd + 1 <= b and check1(i, t):
            # この瞬間の加算分は増減の半分にする
            sm += spd + 0.5
            spd += 1
        # 維持OK
        elif spd <= b and check2(i, t):
            sm += spd
        # 減速必須
        else:
            sm += spd - 0.5
            spd -= 1
    cur += a
print((sm / 4))

-""" -参考：http://ferin-tech.hatenablog.com/entry/2017/10/28/231616 -・愚直に3重ループでシミュレーション -""" -N = int(eval(input())) -tN = list(map(int, input().split())) -vN = list(map(int, input().split())) -# 終点の処理をしやすくするため追加 -tN.append(0) -vN.append(0) -dist = 0 -speed = 0 -for i in range(N): -    keep = True -    plus = True -    # 小数刻みのfor文 -    for j in [0.5 * x for x in range(tN[i] * 2)]: -        # 現在の最大スピードに達した -        if speed == vN[i]: -            plus = False -        rest = tN[i] - j -        # 今より先で、下げきれなくなる状況がないか確認 -        for k in range(i + 1, N + 1): -            if vN[k] < vN[i] and rest <= speed - vN[k]: -                keep = False -                plus = False -            rest += tN[k] -        # フラグの状況に合わせて加速or維持or減速 -        if plus: -            # ここでの数値の加減は進み方が0.5刻みなので注意する -            dist += speed / 2 -            speed += 0.5 -            dist += 0.125 -        elif keep: -            dist += speed / 2 +import sys + + +def input(): +    return sys.stdin.readline().strip() + + +def list2d(a, b, c): +    return [[c] * b for i in range(a)] + + +def list3d(a, b, c, d): +    return [[[d] * c for j in range(b)] for i in range(a)] + + +def list4d(a, b, c, d, e): +    return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)] + + +def ceil(x, y=1): +    return int(-(-x // y)) + + +def INT(): +    return int(eval(input())) + + +def MAP(): +    return list(map(int, input().split())) + + +def LIST(N=None): +    return list(MAP()) if N is None else [INT() for i in range(N)] + + +def Yes(): +    print("Yes") + + +def No(): +    print("No") + + +def YES(): +    print("YES") + + +def NO(): +    print("NO") + + +sys.setrecursionlimit(10**9) +INF = 10**18 +MOD = 10**9 + 7 +N = INT() +# 0.5考慮のため*2、終了時0のため番兵 +A = [a * 2 for a in LIST()] + [1] +B = [b * 2 for b in LIST()] + [0] + + +def check1(i, t): +    nxtt = cur +    for j in range(i + 1, N + 1): +        nxtt += A[j - 1] +        dist = nxtt - t +        # 1つ先で+1の状態でいても大丈夫かどうか +        if spd + 2 - dist > B[j]: +            return False +    return True + + +def check2(i, t): +    nxtt = cur +    for j in range(i + 1, N + 1): +        nxtt += A[j - 1] +        dist = nxtt - t +        # 1つ先で今と同じ(+-0)の状態でいても大丈夫かどうか +        if spd + 1 - dist > B[j]: +            return False +    return True + + +cur = spd = sm = 0 +for i, a in enumerate(A[:N]): +    b = B[i] +    # 各時点tにおいて加速、維持が可能かどうか確認 +    for t in range(cur, cur + a): +        # 加速OK +        if spd + 1 <= b and check1(i, t): +            # この瞬間の加算分は増減の半分にする +            sm += spd + 0.5 +            spd += 1 +        # 維持OK +        elif spd <= b and check2(i, t): +            sm += spd +        # 減速必須 -            speed -= 0.5 -            dist += speed / 2 -            dist += 0.125 -print(dist) +            sm += spd - 0.5 +            spd -= 1 +    cur += a +print((sm / 4))