Advertisement
veronikaaa86

07. Trekking Mania

May 29th, 2022
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. count_groups = int(input())
  2.  
  3. musala_count = 0
  4. montblanc_count = 0
  5. kilimanjaro_count = 0
  6. k2_count = 0
  7. everest_count = 0
  8. total_count_people = 0
  9. for i in range(1, count_groups + 1):
  10. count_people = int(input())
  11. total_count_people += count_people
  12.  
  13. if count_people <= 5:
  14. musala_count += count_people
  15. elif count_people <= 12:
  16. montblanc_count += count_people
  17. elif count_people <= 25:
  18. kilimanjaro_count += count_people
  19. elif count_people <= 40:
  20. k2_count += count_people
  21. else:
  22. everest_count += count_people
  23.  
  24. musala_percent = musala_count / total_count_people * 100
  25. print(f"{musala_percent:.2f}%")
  26. montblanc_percent = montblanc_count / total_count_people * 100
  27. print(f"{montblanc_percent:.2f}%")
  28. kilimanjaro_percent = kilimanjaro_count / total_count_people * 100
  29. print(f"{kilimanjaro_percent:.2f}%")
  30. k2_percent = k2_count / total_count_people * 100
  31. print(f"{k2_percent:.2f}%")
  32. everest_percent = everest_count / total_count_people * 100
  33. print(f"{everest_percent:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement