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