Advertisement
ForestFox

Untitled

May 2nd, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. f = open('27-8a.txt')
  2. a = list(map(int, f.readlines()[1:]))
  3. k = float('inf')
  4. for i in range(len(a)-5):
  5. for j in range(i+5, len(a)):
  6. if a[i]**2 + a[j]**2 < k:
  7. k = a[i]**2 + a[j]**2
  8. print(k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement