veronikaaa86

08. Lunch Break

Sep 18th, 2022
1,347
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 1 0
  1. from math import ceil
  2.  
  3. name_episode = input()
  4. episode_duration = int(input())
  5. break_duration = int(input())
  6.  
  7. lunch_time = break_duration / 8
  8. relax_time = break_duration / 4
  9.  
  10. time = break_duration - lunch_time - relax_time
  11.  
  12. diff = abs(time - episode_duration)
  13. rounded_diff = ceil(diff)
  14. if time >= episode_duration:
  15.     print(f"You have enough time to watch {name_episode} and left with {rounded_diff} minutes free time.")
  16. else:
  17.     print(f"You don't have enough time to watch {name_episode}, you need {rounded_diff} more minutes.")
Advertisement
Add Comment
Please, Sign In to add comment