Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import math
  2. companion = int(input())
  3. days = int(input())
  4. coins = 0
  5.  
  6. for i in range(1, days + 1):
  7.     motivation = False
  8.     if i % 10 == 0:
  9.         companion -= 2
  10.     if i % 15 == 0:
  11.         companion += 5
  12.     coins += 50
  13.     coins -= companion * 2
  14.     if i % 3 == 0:
  15.         coins -= companion * 3
  16.         motivation = True
  17.     if i % 5 == 0:
  18.         coins += 20 * companion
  19.         if motivation:
  20.             coins -= 2 * companion
  21.  
  22. print(f"{companion} companions received {math.floor(coins/companion)} coins each.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement