BbJLeB

02. Sleepy Tom Cat

May 10th, 2019
181
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. day_off = int(input())
  3.  
  4. day_work = 365 - day_off
  5.  
  6. play_day_off = day_off * 127
  7. play_day_work = day_work * 63
  8. play_for_year = play_day_off + play_day_work
  9.  
  10. if play_for_year <= 30000:
  11.     hours = (30000 - play_for_year) // 60
  12.     minutes = (30000 - play_for_year) % 60
  13.     print(f"Tom sleeps well")
  14.     print(f"{hours} hours and {minutes} minutes less for play")
  15. else:
  16.     hours = (play_for_year - 30000) // 60
  17.     minutes = (play_for_year - 30000) % 60
  18.     print(f"Tom will run away")
  19.     print(f"{hours} hours and {minutes} minutes more for play")
Advertisement
Add Comment
Please, Sign In to add comment