Advertisement
exDotaPro

20_april_2019_2_easter_guests

Jan 5th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from math import ceil
  2.  
  3. guests = int(input())
  4. budget = int(input())
  5.  
  6. easter_bread = ceil(guests / 3)
  7. eggs = guests * 2
  8.  
  9. easter_bread_price = easter_bread * 4
  10. eggs_price = eggs * 0.45
  11. total_sum = easter_bread_price + eggs_price
  12.  
  13. diff = abs(budget - total_sum)
  14.  
  15. if total_sum <= budget:
  16.     print(f'Lyubo bought {easter_bread} Easter bread and {eggs} eggs.')
  17.     print(f'He has {diff:.2f} lv. left.')
  18. else:
  19.     print(f'Lyubo doesn\'t have enough money.')
  20.     print(f'He needs {diff:.2f} lv. more.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement