Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('9.txt')
- count = 0
- 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]
- else:
- A_unrep += [elem]
- if len(A_rep) == 1 and len(A_unrep) == 4 and sum(A_unrep) / 4 <= 2 * A_rep[0]:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment