int input int input for in range if print else ans for in range ans mi

1
2
3
4
5
6
7
8
9
n = int(input())
e = [int(input()) for i in range(n)]
if n < 6:
print(1)
else:
ans = e[0] ** 2 + e[5] ** 2
for i in range(1, n - 5):
ans = min(ans, e[i] ** 2 + e[i + 5] ** 2)
print(ans)