Advertisement
Nenogzar

Untitled

Oct 15th, 2023
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import math
  2.  
  3. absence_in_days = int(input()) # days
  4. food_supply = int(input()) # kg
  5. deer_one = float(input())
  6. deer_two = float(input())
  7. deer_three = float(input())
  8.  
  9. needed_food = (deer_one+deer_two+deer_three) * absence_in_days
  10. difference_food = abs(food_supply - needed_food)
  11. if needed_food < food_supply:
  12.     print(f"{math.floor(difference_food)} kilos of food left.")
  13. else:
  14.     print(f"{math.ceil(difference_food)} more kilos of food are needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement