Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # време за обяд = 1/8 от почивката
- # време за отдих = 1/4 от почивката
- # време за сериал
- # oбщо = време за обяд + време за отдих + време за сериал
- import math
- movie_name = input()
- movie_time = int(input())
- lunch_break_time = int(input())
- lunch_time = 1 / 8 * lunch_break_time # lunch_break_time / 8
- rest_time = 1 / 4 * lunch_break_time
- total_time = lunch_time + rest_time + movie_time
- # времето е достатъчно -> total_time <= lunch_break_time
- if total_time <= lunch_break_time:
- left_time = math.ceil(lunch_break_time - total_time)
- print(f"You have enough time to watch {movie_name} and left with {left_time} minutes free time.")
- else:
- need_time = math.ceil(total_time - lunch_break_time)
- print(f"You don't have enough time to watch {movie_name}, you need {need_time} more minutes.")
Advertisement
Add Comment
Please, Sign In to add comment