DiYane

Lunch Break

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