Stand on Zanzibar

This commit is contained in:
2023-06-26 23:34:02 +02:00
parent 6b3ff638fe
commit 77431c93b4

14
zanzibar.py Normal file
View File

@@ -0,0 +1,14 @@
t = int(input())
for _ in range(t):
sequence = list(map(int, input().split()))[:-1]
prev_s = 1
lb_import = 0
for s in sequence:
if s > (prev_s * 2):
lb_import += s - prev_s * 2
prev_s = s
print(lb_import)