Advertisement
anton_d

12. xmass_spirit

May 22nd, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.07 KB | None | 0 0
  1. quantity_decorations = int(input())
  2. days_christmas = int(input())
  3.  
  4. ornaments_cost, skirt_cost, garland_cost, lights_cost = 2, 5, 3, 15
  5. ornaments_points, skirt_points, garland_points, lights_points = 5, 3, 10, 17
  6.  
  7. shopping_day = 0
  8. decoration_cost, christmas_spirit = 0, 0
  9.  
  10. while days_christmas > 0:
  11.     days_christmas -= 1
  12.     shopping_day += 1
  13.     if shopping_day % 2 == 0:
  14.         christmas_spirit += 5
  15.         decoration_cost += 2
  16.         if shopping_day % 11 == 0:
  17.             decoration_cost += 2
  18.     if shopping_day % 3 == 0:
  19.         christmas_spirit += 43
  20.         decoration_cost += 8
  21.         if shopping_day % 11 == 0:
  22.             decoration_cost += 8
  23.     if shopping_day % 5 == 0:
  24.         christmas_spirit += 17
  25.         decoration_cost += 15
  26.         if shopping_day % 11 == 0:
  27.             decoration_cost += 15
  28.     if shopping_day % 10 == 0:
  29.         christmas_spirit -= 20
  30.         shopping_day -= 1
  31.     if shopping_day == 10 and days_christmas == 10:
  32.         christmas_spirit -= 30
  33.  
  34. print(f'Total cost: {decoration_cost}\nTotal spirit: {christmas_spirit}')
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement