summaryrefslogtreecommitdiffstats
path: root/Main/Python/2021/S1.py
blob: d124184b3f729f02da359f10e4842de5a6cfc453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
n = int(input())

heights = tuple(map(int, input().split()))

widths = tuple(map(int,input().split()))

base1 = heights[0]

area = 0
for i, w in enumerate(widths):
    area += (base1 + heights[i+1]) / 2 * w
    base1 = heights[i+1]

print(area)