Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = open('17 (2).txt').readlines()
- a = list(map(int, data))
- cnt = 0
- mx = -1
- for x in a:
- for y in a:
- if x == y:
- continue
- if (x - y) % 2 == 0 and (x % 31 == 0 or y % 31 == 0):
- cnt += 1
- mx = max(mx, x + y)
- print(cnt // 2, mx) #делим на 2 тк порядок элементов в паре не важен
Advertisement
Add Comment
Please, Sign In to add comment