Advertisement
Spocoman

Sweet Dessert

Oct 1st, 2023 (edited)
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. from math import ceil
  2.  
  3. budget = float(input())
  4. guests = int(input())
  5. banana_price = float(input())
  6. egg_price = float(input())
  7. berries_kilo_price = float(input())
  8.  
  9. needed_money = ceil(guests / 6) * (banana_price * 2 + egg_price * 4 + berries_kilo_price / 5)
  10.  
  11. if budget >= needed_money:
  12.     print(f"Ivancho has enough money - it would cost {needed_money:.2f}lv.")
  13. else:
  14.     print(f"Ivancho will have to withdraw money - he will need {needed_money - budget:.2f}lv more.")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement