nq1s788

17 сравнение с минимумом

Feb 14th, 2026
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. data = open('107_17.txt').readlines()
  2. a = list(map(int, data))
  3. mn = 100000000
  4. for e in a:
  5.     if e % 21 == 0:
  6.         mn = min(mn, e)
  7. cnt = 0
  8. mx = -1
  9. for i in range(len(a) - 1):
  10.     if a[i] % mn == 0 or a[i + 1] % mn == 0:
  11.         cnt += 1
  12.         mx = max(mx, a[i] + a[i + 1])
  13. print(cnt, mx)
Advertisement
Add Comment
Please, Sign In to add comment