Advertisement
WupEly

Untitled

Mar 2nd, 2023
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. from sys import stdin
  2.  
  3.  
  4. def count_seven(arr: list) -> int:
  5. counter = 0
  6.  
  7. for num in arr:
  8. if num % 7 == 0:
  9. counter += 1
  10.  
  11. return counter
  12.  
  13. d = {}
  14.  
  15. for line in stdin:
  16. line = list(map(int, line.split()))
  17. if count_seven(line) not in d.keys():
  18. d[count_seven(line)] = list(map(str, list(filter(lambda x: x % 7 == 0, line))))
  19.  
  20. print(", ".join(d[max(d.keys())]))
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement