Advertisement
tod36

10. Christmas Spirit

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