Advertisement
Spocoman

Cake Tycoon

Oct 11th, 2023
848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. planned_cakes = int(input())
  2. cake_flour = float(input())
  3. flour_available = int(input())
  4. truffle_count = int(input())
  5. truffle_price = int(input())
  6.  
  7. cakes = int(flour_available / cake_flour)
  8.  
  9. if cakes >= planned_cakes:
  10.     cake_price = truffle_count * truffle_price / planned_cakes * 1.25
  11.     print(f"All products available, price of a cake: {cake_price:.2f}")
  12. else:
  13.     flour_needed = planned_cakes * cake_flour - flour_available
  14.     print(f"Can make only {cakes} cakes, need {flour_needed:.2f} kg more flour")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement