Sichanov

bike race

Apr 22nd, 2021
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. junior_bikers = int(input())
  2. senior_bikers = int(input())
  3. type_of_the_race = input()
  4. bills = 0
  5. total_sum = 0
  6. final_sum = 0
  7. discount = 0
  8. total_bikers = senior_bikers + junior_bikers
  9.  
  10. if type_of_the_race == "trail":
  11.     total_sum = (junior_bikers * 5.50) + (senior_bikers * 7)
  12.  
  13. elif type_of_the_race == "cross-country":
  14.     total_sum = (junior_bikers * 8) + (senior_bikers * 9.50)
  15.     if total_bikers >= 50:
  16.         discount = total_sum * 0.25
  17.  
  18. elif type_of_the_race == "downhill":
  19.     total_sum = (junior_bikers * 12.25) + (senior_bikers * 13.75)
  20.  
  21. elif type_of_the_race == "road":
  22.     total_sum = (junior_bikers * 20) + (senior_bikers * 21.50)
  23.  
  24. total_sum_with_discount = total_sum - discount
  25. bills = total_sum_with_discount * 0.05
  26. final_sum = total_sum_with_discount - bills
  27. print(f"{final_sum:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment