Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = [0]
V = [0]
T.extend(list(map(int, input().split())))
V.extend(list(map(int, input().split())))
V.append(0)


Z = [0] * (len(T))
K = [[0, 0]]
for i in range(len(T)-1):
    Z[i+1] = Z[i] + T[i+1]
    K.append([Z[i], Z[i+1]])
gokei_T = sum(T)

K.append([gokei_T, gokei_T])

ans = 0
time_table = [0.5*i for i in range(2*gokei_T+1)]

for time in time_table:
    speed = 10**5
    for k, v in zip(K, V):
        if time <= k[0]:
            tmp = v + (k[0]-time)
        elif k[0] <= time <= k[1]:
            tmp = v
        elif k[1] <= time:
            tmp = v + (time - k[1])

        speed = min(speed, tmp)
    ans += 0.5 * speed

print(ans)

Fixed submission:
"""
prd_xxx 様のコードを参考にさせていただきました。感謝です...！
https://beta.atcoder.jp/contests/abc076/submissions/1724160
"""

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

maxv = [0]
# グラフを整える準備
for v, t in zip(V, T):
    # 転換地点では低い方に合わせる
    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(range(T-1)):
    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5)

ans = 0
# 台形計算
for i in range(T-1):
    ans += (maxv[i] + maxv[i+1]) * 0.25
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy

N = int(input())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
T.insert(0, 0)
V.insert(0, 0)
V.append(0)

Z = [0] * (len(T))
for i in range(len(T)-1):
    Z[i+1] = Z[i] + T[i+1]
gokei_T = sum(T)
K = [[0, 0]]
for i in range(N):
    K.append([Z[i], Z[i+1]])
K.append([gokei_T, gokei_T])

ans = 0
for time in numpy.arange(0, gokei_T, 0.5):
    speed = 10**5
    for k, v in zip(K, V):
        if time <= k[0]:
            tmp = v + (k[0]-time)
        elif k[0] <= time <= k[1]:
            tmp = v
        elif k[1] <= time:
            tmp = v + (time - k[1])

        speed = min(speed, tmp)
    ans += 0.5 * speed

print(ans)

Fixed submission:
"""
prd_xxx 様のコードを参考にさせていただきました。感謝です...！
https://beta.atcoder.jp/contests/abc076/submissions/1724160
"""

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

maxv = [0]
# グラフを整える準備
for v, t in zip(V, T):
    # 転換地点では低い方に合わせる
    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(range(T-1)):
    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5)

ans = 0
# 台形計算
for i in range(T-1):
    ans += (maxv[i] + maxv[i+1]) * 0.25
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
T.insert(0, 0)
V.insert(0, 0)
V.append(0)

Z = [0] * (len(T))
for i in range(len(T)-1):
    Z[i+1] = Z[i] + T[i+1]

K = [[0, 0]]
for i in range(N):
    K.append([Z[i], Z[i+1]])
K.append([sum(T), sum(T)])

ans = 0
time_table = [0.5*i for i in range(2*sum(T)+1)]

for time in time_table:
    speed = 10**5
    for k, v in zip(K, V):
        if time <= k[0]:
            tmp = v + (k[0]-time)
        elif k[0] <= time <= k[1]:
            tmp = v
        elif k[1] <= time:
            tmp = v + (time - k[1])

        speed = min(speed, tmp)
    ans += 0.5 * speed

print(ans)

Fixed submission:
"""
prd_xxx 様のコードを参考にさせていただきました。感謝です...！
https://beta.atcoder.jp/contests/abc076/submissions/1724160
"""

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

maxv = [0]
# グラフを整える準備
for v, t in zip(V, T):
    # 転換地点では低い方に合わせる
    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(range(T-1)):
    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5)

ans = 0
# 台形計算
for i in range(T-1):
    ans += (maxv[i] + maxv[i+1]) * 0.25
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy

N = int(input())
T = list(map(int, input().split()))
V = list(map(int, input().split()))
T.insert(0, 0)
T.append(sum(T))
V.insert(0, 0)
V.append(0)

Z = [0] * (len(T))
for i in range(len(T)-1):
    Z[i+1] = Z[i] + T[i+1]


def calc_speed(l, r, x, v):
    if x <= l:
        return v + (l-x)
    if l <= x <= r:
        return v
    if r <= x:
        return v + (x-r)


ans = 0
time_table = [0.5*i for i in range(sum(T)+1)]

for time in time_table:
    speed = 10**5
    for i in range(N+1):
        zero_speed = calc_speed(0, 0, time, 0)
        T_speed = calc_speed(sum(T), sum(T), time, 0)
        speed = min(speed, zero_speed, T_speed, calc_speed(Z[i], Z[i+1], time, V[i+1]))
    ans += 0.5 * speed

print(ans)


Fixed submission:
"""
prd_xxx 様のコードを参考にさせていただきました。感謝です...！
https://beta.atcoder.jp/contests/abc076/submissions/1724160
"""

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

maxv = [0]
# グラフを整える準備
for v, t in zip(V, T):
    # 転換地点では低い方に合わせる
    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(range(T-1)):
    maxv[i] = min(maxv[i], maxv[i + 1] + 0.5)

ans = 0
# 台形計算
for i in range(T-1):
    ans += (maxv[i] + maxv[i+1]) * 0.25
print(ans)