Files
pythonProject/17.py
Victor Alexandrovich Tsyrenschikov 7aa4b53909 python
2026-03-30 20:20:58 +05:00

12 lines
343 B
Python

b=ma=0
f=open('17_1.txt')
mi=10**10
o=[int(i) for i in f]
for i in range(len(o)):
if abs(o[i])%10==6:
mi=min(mi,o[i])
for i in range(len(o)-1):
if ((abs(o[i])%10==6 and abs(o[i+1])%10!=6) or (abs(o[i])%10!=6 and abs(o[i+1])%10==6)) and (o[i]**2+o[i+1]**2)< mi**2:
b+=1
ma=max(ma,(o[i]**2+o[i+1]**2))
print(b,ma)