Advertisement
Spocoman

Easter Bake

Feb 21st, 2022 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import math
  2.  
  3. quantity = int(input())
  4. sugar_total = 0
  5. flour_total = 0
  6. max_sugar = 0
  7. max_flour = 0
  8.  
  9. for i in range(quantity):
  10.     sugar = float(input())
  11.     flour = float(input())
  12.  
  13.     if max_sugar < sugar:
  14.         max_sugar = sugar
  15.  
  16.     if max_flour < flour:
  17.         max_flour = flour
  18.  
  19.     sugar_total += sugar
  20.     flour_total += flour
  21.  
  22. print(f"Sugar: {math.ceil(sugar_total / 950)}")
  23. print(f"Flour: {math.ceil(flour_total / 750)}")
  24. print(f"Max used flour is {int(max_flour)} grams, max used sugar is {int(max_sugar)} grams.")
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement