Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=48438
- data = open('17.txt').readlines()
- mn = 10000000
- for i in range(len(data)):
- a = int(data[i])
- if abs(a) % 10 == 7:
- mn = min(mn, a)
- cnt = 0
- mx = -10000000
- for i in range(len(data) - 1):
- a = int(data[i])
- b = int(data[i + 1])
- if (a ** 2 + b ** 2 < mn ** 2) and (((abs(a) % 10 == 7) and (abs(b) % 10 != 7)) or ((abs(a) % 10 != 7) and (abs(b) % 10 == 7))):
- cnt += 1
- mx = max(mx, a ** 2 + b ** 2)
- print(cnt, mx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement