Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- quantity = int(input())
- sugar_total = 0
- flour_total = 0
- max_sugar = 0
- max_flour = 0
- for i in range(quantity):
- sugar = float(input())
- flour = float(input())
- if max_sugar < sugar:
- max_sugar = sugar
- if max_flour < flour:
- max_flour = flour
- sugar_total += sugar
- flour_total += flour
- print(f"Sugar: {math.ceil(sugar_total / 950)}")
- print(f"Flour: {math.ceil(flour_total / 750)}")
- print(f"Max used flour is {int(max_flour)} grams, max used sugar is {int(max_sugar)} grams.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement