]> Skullheadx's Git Forge - CCC.git/commitdiff
2021 S1
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Tue, 27 Sep 2022 13:36:01 +0000 (09:36 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Tue, 27 Sep 2022 13:36:01 +0000 (09:36 -0400)
Main/Python/2021/S1.py [new file with mode: 0644]

diff --git a/Main/Python/2021/S1.py b/Main/Python/2021/S1.py
new file mode 100644 (file)
index 0000000..d124184
--- /dev/null
@@ -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