Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open("9_12918.txt")
- for s in file:
- A = list(map(int, s.split()))
- A.sort()
- d = {elem:0 for elem in A}
- for elem in A:
- d[elem] += 1
- A_rep = []
- A_unrep = []
- for elem in d:
- if d[elem] == 2:
- A_rep += [elem]
- if d[elem] == 1:
- A_unrep += [elem]
- if len(A_rep) == 2 and len(A_unrep) == 2 and d[A[-1]] == 1 and A[-1] * A[0] > sum(A[1:-1]):
- print(sum(A))
- break
Advertisement
Add Comment
Please, Sign In to add comment