From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Tue, 27 Sep 2022 13:36:01 +0000 (-0400) Subject: 2021 S1 X-Git-Url: http://git.skullheadx.com/nixos/blog/static/gitweb.css?a=commitdiff_plain;h=41bdc8882637b1753bc5dc0300993fe6e340bd39;p=CCC.git 2021 S1 --- diff --git a/Main/Python/2021/S1.py b/Main/Python/2021/S1.py new file mode 100644 index 0000000..d124184 --- /dev/null +++ b/Main/Python/2021/S1.py @@ -0,0 +1,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) \ No newline at end of file