Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cup = 140
- big_spoon = 20
- small_spoon = 10
- cookies_per_box = 5
- single_cookie_grams = 25
- batches = int(input())
- total_boxes = 0
- for b in range(batches):
- flour = int(input())
- sugar = int(input())
- cocoa = int(input())
- flour_cups = flour // cup
- sugar_spoons = sugar // big_spoon
- cocoa_spoons = cocoa // small_spoon
- boxes_of_cookies = ((cup + big_spoon + small_spoon) \
- * min(flour_cups, sugar_spoons, cocoa_spoons) \
- // single_cookie_grams // cookies_per_box)
- if boxes_of_cookies == 0:
- print('Ingredients are not enough for a box of cookies.')
- else:
- print(f'Boxes of cookies: {boxes_of_cookies}')
- total_boxes += boxes_of_cookies
- print(f'Total boxes: {total_boxes}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement