dxnge

25

Dec 7th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. with open('17-1.txt') as f:
  2.     a = list(map(int, f.readlines()))
  3.     sred = sum(a) // len(a)
  4.     cnt = 0
  5.     summa = float('-inf')
  6.     for i in zip(a, a[1:]):
  7.         if all(x > sred for x in i) and sum(i)%100 == 31:
  8.             cnt += 1
  9.             if summa < sum(i):
  10.                 summa = sum(i)
  11. print(cnt, summa)
  12.  
Advertisement
Add Comment
Please, Sign In to add comment