Advertisement
Nenogzar

Untitled

Oct 22nd, 2023
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. number_of_decoration = int(input())
  2. days = int(input())
  3. christmas_spirit = 0
  4. total = 0
  5.  
  6. multipliers = {
  7.     2: (2, 5),
  8.     3: (8, 13),
  9.     5: (15, 17),
  10.     10: (23, -20)
  11. }
  12.  
  13. for day in range(1, days + 1):
  14.     if day % 11 == 0:
  15.         number_of_decoration += 2
  16.  
  17.     if day in multipliers:
  18.         multiplier_cost, multiplier_spirit = multipliers[day]
  19.         total += number_of_decoration * multiplier_cost
  20.         christmas_spirit += multiplier_spirit
  21.  
  22.     if day % 3 == 0 and day % 5 == 0:
  23.         christmas_spirit += 30
  24.  
  25.     if day % 10 == 0:
  26.         christmas_spirit -= 30
  27.  
  28. print(f"Total cost: {total}")
  29. print(f"Total spirit: {christmas_spirit}")
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement