Advertisement
yordan_yordanov

06. Easter Competition

Aug 20th, 2020
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. import math
  2. easter_bread = int(input())
  3.  
  4. sugar_used = 0
  5. flour_used = 0
  6. max_flour = 0
  7. max_sugar = 0
  8.  
  9. for i in range(1, easter_bread + 1):
  10.     current_sugar = int(input())
  11.     sugar_used += current_sugar
  12.     if current_sugar > max_sugar:
  13.         max_sugar = current_sugar
  14.     current_flour = int(input())
  15.     flour_used += current_flour
  16.     if current_flour > max_flour:
  17.         max_flour = current_flour
  18.  
  19. sugar = math.ceil(sugar_used / 950)
  20. flour = math.ceil(flour_used / 750)
  21.  
  22. print(f'Sugar: {sugar}')
  23. print(f'Flour: {flour}')
  24. print(f'Max used flour is {max_flour} grams, max used sugar is {max_sugar} grams.')
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement