Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('17-1.txt') as f:
- a = list(map(int, f.readlines()))
- sred = sum(a) // len(a)
- cnt = 0
- summa = float('-inf')
- for i in zip(a, a[1:]):
- if all(x > sred for x in i) and sum(i)%100 == 31:
- cnt += 1
- if summa < sum(i):
- summa = sum(i)
- print(cnt, summa)
Advertisement
Add Comment
Please, Sign In to add comment