Farz0l1x

Untitled

May 8th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. a = [int(x) for x in open('17_7619.txt')]
  2. pairs = []
  3. mx = max(x for x in a if 10 <= x <= 99)
  4.  
  5. for i in range(len(a)-1):
  6. if (a[i]+a[i+1])%mx == 0 and (((10 <= a[i] <= 99) and (not(10 <= a[i+1] <= 99))) or ((10 <= a[i+1] <= 99) and (not (10 <= a[i] <= 99)))):
  7. pairs.append(a[i]+a[i+1])
  8.  
  9. print(len(pairs) ,max(pairs))
Advertisement
Add Comment
Please, Sign In to add comment