simeonshopov

Cristmas spirit / broken

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