ivantanchev

swim record

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