Spocoman

10. Christmas Spirit

Jan 14th, 2022 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. quantity = int(input())
  2. days = int(input())
  3.  
  4. total_spirit = 0
  5. budget = 0
  6.  
  7. for i in range(1, days + 1):
  8.     if i % 15 == 0:
  9.         total_spirit += 30
  10.     if i % 11 == 0:
  11.         quantity += 2
  12.     if i % 10 == 0:
  13.         total_spirit -= 20
  14.         budget += 23
  15.     if i % 5 == 0:
  16.         total_spirit += 17
  17.         budget += quantity * 15
  18.     if i % 3 == 0:
  19.         total_spirit += 13
  20.         budget += quantity * 8
  21.     if i % 2 == 0:
  22.         total_spirit += 5
  23.         budget += quantity * 2
  24.  
  25. if days % 10 == 0:
  26.     total_spirit -= 30
  27.  
  28. print(f'Total cost: {budget}\nTotal spirit: {total_spirit}')
  29.  
Add Comment
Please, Sign In to add comment