Petar_Matev

2 Bike Race

Jan 29th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. # 2. Вело състезание
  2.  
  3. num_juniors = int(input())
  4. num_seniors = int(input())
  5. route = str(input())
  6.  
  7. junior_ticket = 0
  8. senior_ticket = 0
  9. total_tickets = num_juniors + num_seniors
  10.  
  11. if route == "trail":
  12.     junior_ticket = 5.50
  13.     senior_ticket = 7
  14. elif route == "cross-country":
  15.     junior_ticket = 8
  16.     senior_ticket = 9.50
  17. elif route == "downhill":
  18.     junior_ticket = 12.25
  19.     senior_ticket = 13.75
  20. elif route == "road":
  21.     junior_ticket = 20
  22.     senior_ticket = 21.50
  23.  
  24. income = num_juniors * junior_ticket + num_seniors * senior_ticket
  25.  
  26. if total_tickets >= 50 and route == "cross-country":
  27.     income *= 0.75
  28.  
  29. expense = income * 0.05
  30. charitable_amount = income - expense
  31. print(f"{charitable_amount:.2f}")
  32.  
Advertisement
Add Comment
Please, Sign In to add comment