Stand on Zanzibar
This commit is contained in:
14
zanzibar.py
Normal file
14
zanzibar.py
Normal 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)
|
||||
Reference in New Issue
Block a user