aneliabogeva

World Swimming Record

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