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