Advertisement
Spocoman

Easter Guests

Feb 21st, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. import math
  2.  
  3. guest = int(input())
  4. budget = float(input())
  5. total_sum = math.ceil(guest / 3) * 4 + guest * 2 * 0.45
  6.  
  7. if budget >= total_sum:
  8.     print(f"Lyubo bought {math.ceil(guest / 3)} Easter bread and {guest * 2} eggs.")
  9.     print(f"He has {budget - total_sum:.2f} lv. left.")
  10. else:
  11.     print("Lyubo doesn't have enough money.")
  12.     print(f"He needs {total_sum - budget:.2f} lv. more.")
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement