Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # време за плуване = разстоянието * време за 1 м
- # забавяне = floor(разстоянието / 15) * 12.5 сек
- # времето на Иван = време за плуване + забавянето
- # проверка дали подобрява рекорда
- from math import floor
- record = float(input())
- distance = float(input())
- time_per_meter = float(input())
- swim_time = distance * time_per_meter
- delay_time = floor(distance / 15) * 12.5
- total_time = swim_time + delay_time
- if total_time < record:
- # подобравя рекорда
- print(f"Yes, he succeeded! The new world record is {total_time:.2f} seconds.")
- else:
- # не подобрява рекорда
- need_time = total_time - record
- print(f"No, he failed! He was {need_time:.2f} seconds slower.")
Advertisement
Add Comment
Please, Sign In to add comment