dxnge

13

Oct 1st, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. with open('17-3.txt') as f:
  2.     a = list(map(int, f.read().split()))
  3.  
  4. print(len(list(filter(lambda x: sum(x) % 3 == 0 and sum(x) % 6 != 0 and abs(x[0]*x[1]) % 10 == 8, zip(a, a[1:])))))
  5. print(max(list(map(sum, (filter(lambda x: sum(x) % 3 == 0 and sum(x) % 6 != 0 and x[0]*x[1] % 10 == 8, zip(a, a[1:])))))))
Advertisement
Add Comment
Please, Sign In to add comment