jootiee

Untitled

Jan 13th, 2022 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. with open("27-B.txt", "r", encoding="utf-8") as f:
  2. data = f.readlines()
  3. participators = [list() for i in range(5000)]
  4. for index, line in enumerate(data):
  5. if not index:
  6. n = int(line.split()[1])
  7. continue
  8. number, a, b, c = map(int, line.split())
  9. participators[number].append(max([a, b, c]))
  10.  
  11. participators = list(filter(lambda x: len(x) > n, participators))
  12. participators = sorted(list(map(lambda x: sum(x) / len(x), participators)))
  13. print(participators[-1] - participators[0])
Add Comment
Please, Sign In to add comment