Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("27-B.txt", "r", encoding="utf-8") as f:
- data = f.readlines()
- participators = [list() for i in range(5000)]
- for index, line in enumerate(data):
- if not index:
- n = int(line.split()[1])
- continue
- number, a, b, c = map(int, line.split())
- participators[number].append(max([a, b, c]))
- participators = list(filter(lambda x: len(x) > n, participators))
- participators = sorted(list(map(lambda x: sum(x) / len(x), participators)))
- print(participators[-1] - participators[0])
Add Comment
Please, Sign In to add comment