Advertisement
HuanMatus

Untitled

Jan 18th, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. line = input()
  2. arr = list()
  3. cnt = 0
  4. max_sum = 0
  5. while line:
  6. arr.append(int(line))
  7. line = input()
  8. for i in range(len(arr) - 1):
  9. a = arr[i]
  10. b = arr[i + 1]
  11. if (a % 5 == 0 or b % 5 == 0) and abs(a - b) % 2 > 0:
  12. cnt += 1
  13. max_sum = max(max_sum, a + b)
  14. print(cnt, max_sum) # 957 19523
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement