Advertisement
NOBLE-_-MAN

2

Oct 25th, 2021
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. n = int(input())
  2. good_name = list(map(int, input().split()))
  3. first = 0
  4. second = 0
  5. for i in range(n - 1):
  6.     if good_name[i + 1] > good_name[i]:
  7.         if good_name[i + 1] >= 2000 and good_name[i] >= 2000:
  8.             second += good_name[i + 1] - good_name[i]
  9.         elif good_name[i + 1] >= 2000:
  10.             first += 2000 - good_name[i]
  11.             second += good_name[i + 1] - 2000
  12.         else:
  13.             first += good_name[i + 1] - good_name[i]
  14. print(first, second)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement