Advertisement
BbJLeB

02. Mountain Run

Apr 22nd, 2019
108
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. record_sec = float(input())
  4. distance_metric = float(input())
  5. time_1metric = float(input())
  6.  
  7. need_time = distance_metric * time_1metric
  8. need_time_slow = math.floor(distance_metric/50)
  9. need_time_slow1 = need_time_slow * 30
  10. all_time_need = need_time_slow1 + need_time
  11. shorter_seconds = abs(record_sec - all_time_need)
  12. if all_time_need >= record_sec:
  13.     print (f"No! He was {shorter_seconds:.2f} seconds slower.")
  14. else:
  15.     print(f"Yes! The new record is {all_time_need:.2f} seconds.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement