veronikaaa86

06. World Swimming Record

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