Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- total_food = float(input())
- dog_eaten_food = 0
- cat_eaten_food = 0
- reward = 0
- for i in range(1, days + 1):
- dog_food = int(input())
- cat_food = int(input())
- if i % 3 == 0:
- reward += (dog_food + cat_food) * 0.1
- dog_eaten_food += dog_food
- cat_eaten_food += cat_food
- total_eaten_food = dog_eaten_food + cat_eaten_food
- print(f"Total eaten biscuits: {round(reward)}gr.")
- print(f"{total_eaten_food / total_food * 100:.2f}% of the food has been eaten.")
- print(f"{dog_eaten_food / total_eaten_food * 100:.2f}% eaten from the dog.")
- print(f"{cat_eaten_food / total_eaten_food * 100:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement