Ddimov90

bike_race_02_03

Sep 30th, 2025
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | Source Code | 0 0
  1. young_cyclist = int(input())
  2. old_cyclist = int(input())
  3. type_of_trace = input()
  4.  
  5. total = 0
  6.  
  7. if type_of_trace == "trail":
  8.     total = young_cyclist * 5.5 + old_cyclist * 7
  9. elif type_of_trace == "cross-country":
  10.     total = young_cyclist * 8 + old_cyclist * 9.5
  11.     if young_cyclist + old_cyclist >= 50:
  12.         total *= 0.75
  13. elif type_of_trace == "downhill":
  14.     total = young_cyclist * 12.25 + old_cyclist * 13.75
  15. else:
  16.     total = young_cyclist * 20 + old_cyclist * 21.5
  17.  
  18. total *= 0.95
  19.  
  20. print(f"{total:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment