Advertisement
veronikaaa86

06. World Swimming Record

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