Advertisement
ForestFox

Untitled

May 2nd, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. f = open('27-25b.txt')
  2. N = int(f.readline())
  3. firstpair = list(map(int, f.readline().split()))
  4. for i in range(N-1):
  5. nextpair = list(map(int, f.readline().split()))
  6. combs = sorted([a+b for a in firstpair for b in nextpair])
  7. ost = [0]*8
  8. for x in combs:
  9. ost[x%8] = max(ost[x%8], x)
  10. firstpair = ost
  11.  
  12.  
  13. print(firstpair[3])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement