nq1s788

17 пары различных чисел

Feb 14th, 2026
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. data = open('17 (2).txt').readlines()
  2. a = list(map(int, data))
  3. cnt = 0
  4. mx = -1
  5. for x in a:
  6.     for y in a:
  7.         if x == y:
  8.             continue
  9.         if (x - y) % 2 == 0 and (x % 31 == 0 or y % 31 == 0):
  10.             cnt += 1
  11.             mx = max(mx, x + y)
  12. print(cnt // 2, mx) #делим на 2 тк порядок элементов в паре не важен
Advertisement
Add Comment
Please, Sign In to add comment