Advertisement
veronikaaa86

06. World Swimming Record

Mar 6th, 2022
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import math
  2.  
  3. record_in_seconds = float(input())
  4. distance = float(input())
  5. time_in_sec_for_one = float(input())
  6.  
  7. total_time = distance * time_in_sec_for_one
  8. resistance_time = math.floor(distance / 15) * 12.5
  9. total_time = total_time + resistance_time
  10.  
  11. if total_time < record_in_seconds:
  12. print(f"Yes, he succeeded! The new world record is {total_time:.2f} seconds.")
  13. else:
  14. diff = total_time - record_in_seconds
  15. print(f"No, he failed! He was {diff:.2f} seconds slower.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement