Advertisement
Kaloyankerr

Christmas Spirit

May 22nd, 2020
1,561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. quantity = int(input())
  2. days = int(input())
  3.  
  4. ornament_set = 2
  5. tree_skirt = 5
  6. tree_garlands = 3
  7. tree_lights = 15
  8.  
  9. christmas_spirit = 0
  10. budget = 0
  11.  
  12. for day in range(1, days + 1):
  13.     if day % 11 == 0:
  14.         quantity += 2
  15.  
  16.     if day % 10 == 0:
  17.         christmas_spirit -= 20
  18.         budget += tree_skirt + tree_lights + tree_garlands
  19.  
  20.         if day == days:
  21.             christmas_spirit -= 30
  22.  
  23.     if day % 5 == 0:
  24.         christmas_spirit += 17
  25.         budget += tree_lights * quantity
  26.  
  27.     if day % 15 == 0:
  28.         christmas_spirit += 30 # fifth day with garlands
  29.  
  30.     if day % 3 == 0:
  31.         christmas_spirit += 13
  32.         budget += (tree_garlands + tree_skirt) * quantity
  33.  
  34.     if day % 2 == 0:
  35.         christmas_spirit += 5
  36.         budget += ornament_set * quantity
  37.  
  38. print(f"Total cost: {budget}")
  39. print(f"Total spirit: {christmas_spirit}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement