Advertisement
anton_d

03.harvest

Jan 16th, 2022 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import math
  2.  
  3. field = int(input())  # 650
  4. harvest = float(input())  # 2
  5. liters_wine = int(input())  # 175
  6. workers = int(input())  # 3
  7.  
  8. grapes = field * harvest  # 1300
  9. wine = (grapes * 0.40) / 2.5
  10.  
  11. left = math.ceil(wine - liters_wine)
  12. per_person = math.ceil(left / workers)
  13.  
  14. need = abs(math.floor(left))
  15.  
  16. if wine >= liters_wine:
  17.     print(f'Good harvest this year! Total wine: {wine:.0f} liters.\n{left:.0f} liters left -> {per_person:.0f} liters per person.')
  18. else:
  19.     print(f'It will be a tough winter! More {need:.0f} liters wine needed.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement