DialOG_

Untitled

Feb 21st, 2021
493
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. with open('27_1 — копия (5).txt','r')as f:
  2.     lines = f.read().split('\n')
  3.  
  4.  
  5.  
  6. n = int(lines[0])
  7. a = lines[1:]
  8.  
  9. d = 160
  10. p = 7
  11. c = 0
  12. for i in range(0,n-1):
  13.     for j in range(i+1,n):
  14.         if (int(a[i]) % 160 != int(a[j]) % 160) and (int(a[i]) % 7 == 0 or int(a[j]) % 7 == 0) and (int(a[i])+int(a[j])) > c:
  15.             c = int(a[i])+int(a[j])
  16.             p1 = a[i]
  17.             p2 = a[j]
  18. print(p1,p2)
RAW Paste Data