Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import floor
- companions = int(input())
- days = int(input())
- total_coins = 0
- for day in range(1, days + 1):
- if day % 10 == 0:
- companions -= 2
- if day % 15 == 0:
- companions += 5
- if day % 3 == 0:
- total_coins -= companions * 3
- if day % 5 == 0:
- total_coins += companions * 20
- if day % 3 == 0:
- total_coins -= companions * 2
- total_coins += 50
- total_coins -= companions * 2
- coins_per_companions = floor(total_coins / companions)
- print(f"{companions} companions received {coins_per_companions} coins each.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement