From 41bdc8882637b1753bc5dc0300993fe6e340bd39 Mon Sep 17 00:00:00 2001 From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Tue, 27 Sep 2022 09:36:01 -0400 Subject: [PATCH] 2021 S1 --- Main/Python/2021/S1.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Main/Python/2021/S1.py 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 -- 2.54.0