Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- good_name = list(map(int, input().split()))
- first = 0
- second = 0
- for i in range(n - 1):
- if good_name[i + 1] > good_name[i]:
- if good_name[i + 1] >= 2000 and good_name[i] >= 2000:
- second += good_name[i + 1] - good_name[i]
- elif good_name[i + 1] >= 2000:
- first += 2000 - good_name[i]
- second += good_name[i + 1] - 2000
- else:
- first += good_name[i + 1] - good_name[i]
- print(first, second)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement